Panoply Blog: Data Management, Warehousing & Data Analysis

MariaDB vs MySQL Performance Comparison | Panoply

Written by Mauro Chojrin | Jun 3, 2021 10:23:00 PM

Should I use MySQL or MariaDB? That's probably the question in your mind right now.

So in this post you'll learn what the two products are all about, what they have in common, how they're different, and in which cases you should prefer one or the other.

What MySQL & MariaDB have in common

At a high level, both MySQL and MariaDB are relational databases, which means they share a few characteristics:

  • Information is organized in tables that hold records with a fixed number of fields
  • The SQL language is used to query and manipulate information
  • The relationships between the tables and other entities is known to the database (as opposed to what happens in a non-relational database)

But that's only scratching the surface. After all, the same features are present in other products, such as PostgreSQL, Oracle, etc.

A key thing to keep in mind when comparing MySQL and MariaDB is that they share a common ancestor. MariaDB began its life as a fork of MySQL code when Oracle bought MySQL from Sun Microsystems around 2010. Since then, MariaDB has taken its own path forward. In practice, however, both MariaDB and MySQL look and act in a very similar way.

Let's take a look at the terminal client, for instance:

They both use the same configuration files, default port to connect, etc. In fact MariaDB is fully compatible with MySQL since it was (and still is) intended to be a perfect replacement for MySQL.

A standard MySQL installation comes bundled with a couple of useful tools, such as mysqldump, which is helpful for backups. It can be used with both MySQL and MariaDB.

Another useful tool that's available for working with either MySQL or MariaDB databases is the MySQL WorkBench, a graphical client that's easier to work with than the command line.

What's different about MySQL & MariaDB

While MariaDB and MySQL are pretty similar, there are some key differences to keep in mind when choosing between them, including licensing, performance, and support.

Licensing model

Both tools are available as open source, though they have some differences when it comes to their licensing models: MariaDB uses the GPL License version 2, whereas MySQL uses a more nuanced licensing scheme

What this means in practice is that, if you have the need and skills, it's easier to change the internals of MariaDB and to deploy it wherever you need. When it comes to MySQL, even though the product is also open source, you have to be more careful to avoid legal trouble if you decide to make modifications to the code to deploy or distribute it.

Performance

When MariaDB started as a project, its developers had two main goals in mind:

  1. To perfectly replace MySQL with a GPL license
  2. To offer better performance than MySQL

And they did a pretty good job achieving both.

Generally speaking, MariaDB shows improved speed when compared to MySQL. In particular, MariaDB offers better performance when it comes to views and handling flash storage through its RocksDB engine.

MariaDB also outperforms MySQL when it comes to replication.

Thread pool handling

MariaDB comes with a thread pool mechanism that allows it to handle up to 200,000 simultaneous connections. MySQL can only replicate this number in its enterprise edition.

Storage engines

One of the most celebrated features of MySQL is its ability to work with different data storage engines that can be chosen per table. Since this is a core feature of MySQL, MariaDB also has it, though it goes a couple of steps further by offering a wider array of options out of the box, which include the following:

  • Aria
  • XtraDB
  • MariaDB ColumnStore
  • RocksDB

You can see the full list of supported engines here.

Although these engines can be added to a standard MySQL installation, it can be a cumbersome procedure.

System versioned tables

System versioned tables are a feature unique to MariaDB that allows the storage and querying of historical data right in the database. This makes it really easy to compare current and old data.

Support

Last but not least, there's the issue of support. While MySQL has a big corporation behind it, MariaDB has to rely on the community for growth and support. This means that MySQL has far more resources at its disposal, so new features and improvements can be released in shorter time frames. And if you need professional support, it will be easier to get it in a timely fashion if you base your applications on MySQL rather than MariaDB.

Integration with programming languages

Since MariaDB and MySQL are compatible at a binary level, the same clients that work with one will do fine with the other. These include drivers such as JDBC, PDO, etc., so if you already have an application using MySQL, the migration to MariaDB should not be an issue.

When to choose MariaDB versus MySQL

While MariaDB has superior technical qualities compared to MySQL, don't base your decision on this alone. Be aware of the differences in licensing costs and levels of support, both of which are critical factors in success.

If you feel comfortable handling issues on your own, you'll probably benefit more from MariaDB's technical advantages. On the other hand, if you want to rest assured that timely support will be there for you (and if you can afford it), a commercial MySQL installation is likely the best choice for you.

No matter which database you go with, if you need to integrate that data with other key business data, you might want to give Panoply a try. With Panoply you can pull data from tons of sources, including both MySQL and MariaDB, non-relational databases such as MongoDB or Couch, or even from Excel files. You can then store that information in a single location that everyone in your organization can access and query it or view the data via your existing BI or analytics tool. To learn more about the power of Panoply, book a personalized demo today.