MySQL and MariaDB both publish their own user lists.
MySQL is used by Facebook, Github, YouTube, Twitter, PayPal, Nokia, Spotify, Netflix, and more.
MariaDB is used by Redhat, DBS, Suse, Ubuntu, 1&1, Ingenico, etc.
There are some exciting new features (such as window functions, role controls, or common table expressions (CTES)) that might be worth mentioning, but this article is only for the purpose of comparing two databases, so we’ll discuss only the features that one side provides specifically to better help readers choose the right database for them.
Let’s take a look at the functionality that only one of the databases specifically provides:
1. JSON data types — Starting with version 5.7, MySQL supports native JSON data types defined by RFC 7159 for efficient access to data in JSON documents.
MariaDB does not provide this enhancement, arguing that JSON data types are not part of the SQL standard. But to support copying data from MySQL, MariaDB defines an alias for JSON, which is essentially a LONGTEXT column. MariaDB claims there is no significant performance difference between the two, but they do not provide benchmark data to support this claim.
It’s worth noting that both MySQL and MariaDB provide jSON-related functions to make it easier to access, parse, and retrieve JSON data.
2. Default authentication — In MySQL 8.0, the default authentication plug-in is caching_sha2_password, not mysql_native_password. This enhancement improves security by using the SHA-256 algorithm.
MySQL Shell — MySQL Shell is an advanced command line client and code editor for MySQL. In addition to SQL, the MySQL Shell provides JavaScript and Python scripting capabilities. However, users cannot use mysqlsh to access the MariaDB server because MariaDB does not support the MySQL X protocol.
4. Encryption — MySQL encrypts redo/undo logs (optional), but does not encrypt temporary tablespace or binary logs. In contrast, MariaDB supports binary log and temporary table encryption.
5. Key Management — MariaDB provides AWS key management plug-ins out of the box. MySQL also provides plug-ins for key management, but they are only available in the Enterprise edition.
6. Sys mode — MySQL 8.0 provides sys mode, a set of objects that help database administrators and software engineers better understand data collected in Performance mode. Sys mode objects can be used for optimization and diagnostics, although MariaDB does not provide this enhancement.
7. Validate_password plugin — The Validate_password plugin is mainly used to test passwords and improve security. MySQL has this plugin enabled by default, but MariaDB does not.
8. Super Read-only — MySQL enhances read_only functionality by providing super read-only mode. If read_only is enabled, the server only allows users with SUPER permission to perform client updates. If super_READ_only is also enabled, the server disallows users with SUPER permission to perform client updates.
9. Invisible columns — This feature is available on MariaDB, MySQL does not support this feature. This feature allows you to create columns that do not appear in the SELECT * statement and do not need to provide values for those columns if their names do not appear in the INSERT statement at INSERT time.
10. Thread pools — MariaDB supports connection thread pools, which are useful for short queries and CPU-intensive workloads (OLTP). In the community version of MySQL, the number of threads is fixed, limiting this flexibility. MySQL plans to add thread pooling to the Enterprise edition.
In recent years, there have been many benchmarks for the performance of the MySQL and MariaDB engines. We don’t think there is a definitive answer to the question “which is faster MySQL or MariaDB?” and it depends a lot on the specific usage scenario, query, number of users and connections, etc.
However, if you do want to know, here are some of the most recent benchmarking results we found. Note that these tests were conducted on a specific set of database + engine combinations (e.g. MySQL+InnoDB), so the conclusions are only relevant to that particular combination.
-
MySQL 8.0 (InnoDB) vs. MariaDB 10.3.7 (MyRocks) https://minervadb.com/index.php/2018/06/01/benchmarking-innodb-and-myrocks-performance-using-sysbench/
-
MariaDB and MySQL 10.1 5.7 on commodity hardware performance contrast: https://mariadb.org/maria-10-1-mysql-5-7-commodity-hardware/
-
MySQL 8.0 vs. MariaDB 10.3.5 http://dimitrik.free.fr/blog/archives/2018/04/mysql-performance-80-and-utf8-impact.html
Both databases provide the ability to copy data from one server to another. The main difference is that most MariaDB versions allow you to copy data from MySQL, which means you can easily migrate MySQL to MariaDB. But the reverse is not so easy, as most MySQL versions don’t allow copying data from MariaDB.
Also, it’s worth noting that MySQL GTID is different from MariaDB GTID, so when data is copied from MySQL to MariaDB, the GTID data will be adjusted accordingly.
Here are some of the differences in replication configuration between the two databases:
-
MySQL’s default binary log format is row-based, whereas in MariaDB the default binary log format is hybrid.
-
Log_bin_compress – This configuration determines whether binary logs can be compressed. This enhancement is unique to MariaDB and therefore not supported by MySQL.
MariaDB’s documentation lists hundreds of incompatibilities between MySQL and MariaDB. Therefore, there is no simple solution to migrate between the two databases.
Most database administrators want MariaDB to be just a branch of MySQL so they can easily migrate between the two. But the latest releases suggest that’s unrealistic. MariaDB is actually a fork of MySQL, which means migrating between them has a lot to think about.
MariaDB supports more storage engine types than MySQL. Then again, it doesn’t matter how many storage engines a database can support, but which database can support the storage engine that suits your needs.
-
MariaDB supports storage engines that include: XtraDB, InnoDB, MariaDB ColumnStore, Aria, Archive, Blackhole, Cassandra Storage Engine, Connect, CSV, FederatedX, Memory, Merge, Mroonga, MyISAM, MyRocks, QQGraph, Sequence Storage Engine, SphinxSE, Spider, TokuDB.
-
MySQL supports storage engines such as InnoDB, MyISAM, Memory, CSV, Archive, Blackhole, Merge, Federated, and Example.
When you install MySQL on some Linux distributions, MariaDB may end up being installed, as it is the default on many (but not all) Linux distributions.
Red Hat Enterprise/CentOS/Fedora/default will install MariaDB Debian releases, and other distributions such as Ubuntu default installation of MySQL.
MariaDB is available as a service running on Amazon Web Services (AWS), Microsoft Azure, and Rackspace Cloud.
MySQL is also available on all three of the platforms mentioned above and runs as a hosted service on Google Cloud Services platform.
So if you’re using Google Cloud platform and want a cloud provider to manage services for you, consider using MySQL, unless you want to install and manage MariaDB instances yourself.
MariaDB is licensed under the GPL V2 license, while MySQL offers two licensing options — GPL V2 (for community edition) and enterprise license.
The main difference between the two licenses for MySQL is the functionality and support services available. Users can use all of MariaDB’s features, but not for MySQL. The community edition of MySQL does not include features such as thread pooling, which can have a significant impact on database and query performance.
In general, MariaDB is published more frequently than MySQL. Posting too often can be both helpful and harmful. On the plus side, users can receive features and bug fixes more promptly. On the bad side, it takes more work to keep MariaDB up to date.
MySQL’s support team (including MySQL developers and support engineers) is available to customers around the clock. Oracle offers a variety of support options, including extended support, ongoing support, and advanced support, depending on the customer’s requirements. The MariaDB support team’s support engineers include MariaDB and MySQL database specialists (since many of the features were originally developed by the MySQL team), who provide enterprise-level support for production systems around the clock.
MySQL is primarily developed by Oracle’s MySQL team, while MariaDB development is conducted through public voting and mailing list discussions. In addition, anyone can submit patches to MariaDB, which the MariaDB development team will consider adding to the main code base. So MariaDB was, to some extent, developed by the community, whereas MySQL was primarily developed by Oracle.
Well, we can’t decide for you. What we can do is ask you targeted questions, and you can decide for yourself:
-
Have you tested your product performance against each database? Which performed better and why?
-
Do you plan to use a feature specifically provided by one of the databases?
-
Do you plan to use a database engine specifically provided by one of the databases?
-
How important is it to you to be able to influence the database development process? How important is it to you to be able to vote on the next feature change?
-
Do you have to pay for the enterprise version or use the community version? Does the features of the Community edition meet your needs?
-
Does your operating system support the database of your choice by default? Does it take a lot of work to deploy it?
-
Which cloud provider are you using? Do they offer a hosting service that includes a database of your choice?
-
Do you plan to migrate from one database type to another in the future? If so, have you considered compatibility and replication issues?
If you can answer these questions well, it may be clear which database is right for you.
English text: https://www.eversql.com/mariadb-vs-mysql/