Many developers have used MySQL, while they have only heard of MariaDB. Let's explore the differences between these two database management systems.
MySQL and MariaDB share common history. MySQL was created in 1995 by a Fino-Swedish company MySQL AB, which was founded by David Axmark, Allan Larsson and Michael "Monty" Widenius. Over the years, MySQL has become a very popular open-source relational database management system (RDBMS), offering both personal and Enterprise versions of the software.
In January 2008, Sun bought MySQL AB for $1 billion. Shortly afterwards, in April 2009, Oracle acquired Sun Microsystems, thus becoming the owner of MySQL. The original developers were concerned about the future of MySQL under Oracle, so they have decided to fork it and create MariaDB.
There is a significant number of new features in MariaDB, which are invisible and designed to improve performance. However, if visible and important features are considered, they are almost the same. There is one important difference, though — storage engines. MariaDB has introduced many new storage engines, such as OQGRAPH (for handling complex graphs), SphinxSE (storage engine compatible with Sphinx search engine), Cassandra (enables NoSQL storage) and more.
For a more detailed list of features that each RDBMS supports, check MySQL features and MariaDB features.
MariaDB is a drop-in replacement for MySQL, meaning that the migration process from MySQL to MariaDB is quite straightforward — simply uninstall MySQL and install MariaDB, without having to convert any data. To ensure maximum compatibility, MariaDB developers perform a monthly merge of MySQL code.
However, there are slight differences between the two RDBMSs and it is possible to have some minor compatibility issues in certain cases. For example, if we compare the latest version of each software, MariaDB 10.1 and MySQL 5.7, we will notice than MariaDB does not support MySQL 5.7's JSON, ngram and MeCab full-text parser plugins and multiple triggers for a table. It also handles InnoDB encryption differently.
Check the list of incompatibilities for the full list of compatibility issues between different versions of MySQL and MariaDB.
Although the performance of these two database management systems has been thoroughly tested, the results haven't always been the same. However, some conclusions could be made.
Both companies have published their own OLTP benchmarks, showing that their software can reach 1 million queries per second. Please note that these tests were run on different configurations and do not reflect real-world situations.
Another test that measured the number of operations per second has shown than MariaDB has around 30% better performance.
On commodity hardware, MariaDB 10.1 performed slightly better than MySQL 5.7. However, MySQL 5.6 had better performance that the former two in the same test.
Softizy has run a real-world test on a Prestashop Web application, comparing MySQL 5.7 and MariaDB 10.1. Without the query cache enabled, MariaDB had 10% better performance up to 20 concurrent connections, while MySQL was 25% better at 220 connections at the same time. When query cache was enabled, MariaDB was a clean winner on all connection numbers, having more than 50% better performance than MySQL on 220 concurrent connections.
It is hard to say which software solution is better, as each one has its own advantages and disadvantages. If you have a high-traffic Web application, it would be a good idea to try to migrate to MariaDB. The same conclusion applies to applications that use Sphinx search or a combination of SQL and NoSQL databases for data analysis and data warehousing. In other cases, keep MySQL.