Nearly a year ago, I accepted an offer to work on the developer relations team at MariaDB Corporation. I remember feeling pretty apprehensive and a little overwhelmed leading up to my first day. To be completely transparent, I didn’t have any previous experience using MariaDB. My first project was to write an application using React.js and Node.js built on MariaDB – oh and I had to present it in front of the entire company in two weeks. No big deal, right?
Sure, throughout my years as an application developer I’d spent time working with relational databases, but the more I read about MariaDB, the more I started to understand just how robust it really is. There are a ton of great resources I leveraged to get up to speed and start building an application on MariaDB quickly. Today is National Online Learning Day and I thought I’d share the top resources I’ve used to help me learn what MariaDB has to offer to provide a jump start into MariaDB that will help others progress even farther and faster than I have.
Oh, by the way, I had my application working within a matter of days, and was able to nail the presentation, all a testament to the power and simplicity of MariaDB.
Getting Started with MariaDB
I don’t know about anyone else, but something that tends to pop up as an obstacle for me with new technologies is just getting started. I couldn’t even tell you how often I’ve spent time looking for content to help get the most basic use case up and running. That can be frustrating, because, after all, we’ve all got a lot of stuff on our plates, and we don’t have unlimited amounts of time on top of our daily workload to spend learning new things. New things that might not even be worth it in the end.
Cutting to the chase, if you want to create a new project that uses MariaDB there are a couple of places I usually start.
1. Using an official MariaDB Server Docker image at https://hub.docker.com/u/mariadb.
This is a great place to start if you want to quickly spin up a local instance of MariaDB Community Server and see what it has to offer. Just install Docker Desktop for the operating system that you’re using and away you go!
On top of following the instructions within the image page on Docker Hub, I’ve also created a GitHub repository for the introduction to Community Server 10.5 webinar we presented back in June that helps to take you from nothing to using MariaDB in a matter of minutes.
2. Install MariaDB directly onto your OS.
Unlike containers, which center around an idea of consistency and portability, you have the option to install MariaDB more “bare metal” style. Currently there are a plethora of supported operating systems and OS distributions that you can install MariaDB on. One of the easiest starting points that I’ve used to help this process is the MariaDB Knowledge Base.
- Getting, Installing, and Upgrading MariaDB
- Installing MariaDB with yum/dnf (for multiple Linux distributions)
- Installing MariaDB MSI Packages on Windows
- Installing MariaDB Server on MacOS with Homebrew
Another viable option for getting MariaDB up and running on your machine is to use a virtual machine. Being more frugal in nature I tend to lean toward using Linux as my OS and VirtualBox for my virtualization.
I’ve found the blog post, “How to Install MariaDB 10.4 on Ubuntu 18.04 / Ubuntu 16.04” by Josphat Mutai to be very helpful. Even though it keys in on specific versions of MariaDB and Ubuntu, it’s very easy to adjust accordingly.
3. Using MariaDB SkySQL, a new MariaDB database-as-a-service
In my mind, the easiest way to work with a database is to not really have to work with the database. Wait, what? OK, what I actually mean is that using a database-as-a-service helps abstract away a lot of the pain points of working with a database, like provisioning an environment/machine, installing and maintaining the database among many other things.
I’m much more partial to writing app code than maintaining databases, which is why SkySQL has really helped me create content at MariaDB that focuses more on the development advantages of MariaDB rather than the minutiae of managing a database.
Connecting to a MariaDB instance
Once you’ve stood up a MariaDB instance the next thing you’ll want to do is connect to it. Again, the MariaDB Knowledge Base is an excellent resource for getting foundational knowledge on what it takes, configuration wise, to connect to a MariaDB instance.
But, as you’ll notice almost immediately, that documentation may seem a little strange, and you might wonder “why is a MariaDB connection using a MySQL client command?”. Well, without getting into all of the rich history of MariaDB, let’s just cut to the chase and say you’re not wrong, that is strange. Unfortunately, the KB isn’t always the best place to get the most up to date information for working with MariaDB.
Fortunately, the documentation team at MariaDB has been working diligently to provide a more robust, up-to-date experience within the Enterprise and SkySQL Documentation portals. There you can find detailed information on a multitude of clients you can use to connect to MariaDB as well as thorough walk-throughs on how to set them up.
From a quick start perspective I’ve found that the instructions for installing and using the MariaDB client to be extremely useful as it can be downloaded, installed, and used within a matter of minutes.
Learning about the capabilities
Nailing down the basics of a new (to you) technology can be very empowering. Standing up and connecting to a new MariaDB instance is only the beginning, of course. Once you’ve reached that point it’s time for the real fun to begin.
Because MariaDB isn’t just another relational database, there are so many directions you can go, and, ultimately, it really depends on what you’re trying to accomplish.
My journey started by getting a basic understanding of MariaDB with the following resources:
- An Introduction to MariaDB Storage Engines (video)
- Learn about MariaDB system internals (video)
- MariaDB Cluster (Galera) (video)
From there I branched out to MariaDB developer focused functionality:
- JSON with MariaDB Platform: What is JSON and why use it – with examples
- An extremely insightful five-part blog series diving temporal tables
- A slightly older, but certainly still relevant article on JSON/GeoJSON & GIS
- A webinar Modern SQL with MariaDB: JSON, temporal tables, and more where Shane Johnson and I dove into a variety of capabilities that help improve developers’ lives.
And starting towards the end of 2019 I started obsessing about the capabilities of MariaDB ColumnStore and Hybrid Transactional/Analytical Processing. The ability to access massive amounts of data to use for analytics is definitely impressive, but being able to access row-based and column-based data stores within a single query absolutely blew my mind.
So much so that I made it a point to include myself in as much of our content as possible, whether my co-workers liked it or not. Just kidding, yeah, not really. Since the beginning of the year I’ve made it a mission of mine to spread the word of MariaDB analytics and HTAP possibilities.
- Getting Started with MariaDB SkySQL and Smart Transactions
- Create beautiful data with MariaDB SkySQL and Apache Zeppelin
Creating Modern Solutions
As I mentioned, for my first MariaDB application I decided to go with a React.js front-end and a Node.js back-end. Complete transparency (again), along with never previously using MariaDB I had also never used either of those, but I knew they were extremely popular and figured, why not? After figuring out how to create the most basic Node applications, I found a presentation on slideshare.net that helped fill in the gaps of how to get started with the MariaDB Node.js Connector.
However, spending some more time perusing Google search results for “react.js node.js mariadb” I realized that the content I was looking for was severely lacking. I found plenty of material about using MySQL with MariaDB, but MariaDB isn’t MySQL anymore. It’s on a whole other level.
So, it’s been a mission of our team to provide content, in a variety of forms, that highlight the functionality of MariaDB with MariaDB connectors and technologies. It started with a new repository called Developer Examples that serves as a glossary of samples using a large array of languages and technologies that not only help show off the power of MariaDB, but, most importantly, help developers get a better understanding of how MariaDB can take their solutions to the next level.
Using the code as a foundation enabled us to create quick walk-throughs for different languages and technologies:
- Getting Started with MariaDB using Docker and Node.js
- Getting Started with MariaDB using Docker, Python and Flask
- Getting Started with MariaDB using Docker, Java Spring and JDBC
- Reactive Programming with Java Spring, R2DBC and MariaDB
Happy national online learning day! I hope these resources help to get you started quickly building applications with MariaDB.