Find Reviews for...

Disclosure: We might receive advertising revenue from some partners.

Database Management: MariaDB vs. MySQL

Graham Cook  — May 16, 2019

For quite a few years, MySQL was known as the leading query optimizer among the pack, especially when it comes to relational databases.

However, there has been a noticeable change happening as MariaDB, the MySQL fork, is making an evident headway. As a result, Wikipedia, as well as a number of big websites, have made the switch.

In this article, the main differences between Maria vs. MySQL will be discussed. Furthermore, it will also attempt to evaluate some of its similarities concerning each software’s performance aspects, main features, security features, and so much more.

As a result, you will get hold of a better understanding of which database works well for you and which of these two can fulfill your requirements.

A Brief History of MySQL

To make this guide more cohesive, it is important to discuss how MySQL came to be. In 1995, a Swedish company started this database.

In 2008, it was purchased by Sun Microsystems. In 2010, Oracle purchased Sun Microsystems. Ever since this purchase, Oracle now takes care, maintains, and manages MySQL.

There were a number of senior engineers who felt that there was some sort of inconsistency as well as conflict of interest between the commercial database of Oracle and that of MySQL.

This is the reason why, at the time of Oracle’s purchase of Sun Microsystems, these senior engineers did not quite agree with what was planned for MySQL. They had a good grasp as to what they were saying considering the fact that they were in charge of developing MySQL at the time.

Due to this conflict, the same group of senior engineers established a fork of the code base used by MySQL. In fact, they even started their own organization, which is now known as MariaDB.

As of the 20th century, both databases are considered as highly efficient and popular in the community of developers. Oracle database remains in the top spot, while MySQL ranks Top 2.

On another note, MariaDB, considering the fact that this database is quite new to the scene, is a bit behind with spots #14 for the overall rating and #9 for the list of relational databases.

Know the Difference: Maria vs. MySQL

Here’s what you need to know about the differences between MariaDB and MySQL…

Default Authentication

The MySQL plugin for the database default authentication is caching_sha2_password and not mysql_native_password; this will greatly improve and enhance security features of the MySQL as compared to that of MariaDB. Furthermore, this uses the algorithm SHA-256.

Parallel Execution of Queries

Keep in mind that the most recent versions of database MariaDB, which is the MariaDB 10.0, actually allows the capability of parallel execution of a number of queries.

This is a good aspect to take note of as some of the queries can easily be replicated in the Slave from the Master. Thus, it can be executed in a parallel form. The idea and concept of parallelism in this particular database provide MariaDB an advantage over MySQL in the execution of queries.

Storage Engines Database

When it comes to having a powerful storage engines database, most developers would prefer the MariaDB. This is because it has an out-of-the-box approach that is not present or available in MySQL.

To make things more clear, the MariaDB can easily install a number of storage engines easily; whereas, the MySQL requires the user to install storage engines manually, such as Aria, XtraDB, and more. In most cases, this long process that the MySQL requires its users to perform may be an inconvenient thing to do.

Thread Pooling

One advantage of the MariaDB is that it has introduced a new concept into the industry of developers; this new concept is known as Thread Pooling. For you to understand the idea behind this concept, imagine the process of needing a number of connections for a particular database.

After which, a thread is opened leading to a connection. Furthermore, there is also a rule that per thread, there should only be one connection.

Well, with MariaDB’s new concept of Thread Pooling, a number of open threads will be pooled and picked up as well as tasked to query the database through a new connection.

The main difference between MariaDB’s Thread Pooling with that of the traditional process is that the need to create a new thread every time there is a new connection is eliminated. Thus, the requests are processed and provided at a faster turnaround time.

Despite this concept of Thread Pooling being available in the MySQL’s Enterprise Editon, developers cannot access it through the Community Edition.

Sys Schema

The Sys Schema is considered a feature that deals with a set of objects that aids software engineers as well as database administrators in interpreting all of the data collected by the program Performance Schema. MySQL heavily relies on this plugin to ensure success in its database.

Moreover, the Sys Schema feature allows its Sys Schema objects to be used by the database, in this case, MySQL, for the optimization as well as the diagnosis of a number of cases.

The Sys Schema can greatly affect and improve the overall aspect and efficiency of a database. It is important to note that MariaDB does not have this plugin enhancement in its program.

Segmented Key Cache

MariaDB also brings to the table another performance improvement by the name of “Segmented Key Cache.” Developers would know that in a typical cache, a number of threads tend to compete with one another to take a lock over a particular cached entry.

Moreover, these locks are referred to as “mutexes.” Thus, when a number of threads are competing for a lock or mutex, there is a high chance that only one of these threads will be able to get hold of a mutex.

Thus, the other threads would be forced to take a step back and wait for the mutex to get freed again before restarting the operation. This process then leads to various execution delays considering the fact that threads tend to slow down the database performance.

In case of MariaDB’s Segmented Key Cache, the thread no longer finds the need to lock the whole page. Instead, it can proceed to lock only the specific segment to which the entire page belongs to.

As a result, a great number of threads can work in parallel. This can generate and allow parallelism in the software; thus, leading to a much better and faster performance of the database.

Password Validation

The plugin feature of validate_password has one goal; it is to perform a test on the passwords used as well as improve the overall security of the database in use. MySQL has this certain advantage as it enables this type of plugin by default. MariaDB, on the hand, doesn’t.

Invisible Columns

Invisible Columns is another advantage that MariaDB has over MySQL. In comparing Maria vs. MySQL, one can tell that there are more concepts introduced by MariaDB as compared to MySQL.

With that in mind, Invisible Columns, as the name suggests, allows the creation of columns that are not listed in the results of the statement “Select.” Furthermore, Invisible Columns no longer require the application to be assigned a particular value in the “Insert” statement even at times when the required name is not mentioned in the said statement.

Super Read-Only

One of the advantages of MySQL is that it has greatly enhanced the user experience when it comes to read_only capabilities. This is done by providing developers and users with Super Read-Only Mode.

If the read_only mode system variable is turned on, this means that the server allows the users to receive client updates; however, it will only be from the users who have been given the “Super Privilege.”

On another note, if the super_read_only mode system variable is also turned on, this means that the server prohibits the users from receiving client updates despite it being from those users who have been given the “Super Privilege.”

Final Thoughts on Maria vs. MySQL

Over the years, both MariaDB and MySQL have gained loyal customers on both ends. In all honesty, there is no real answer to which is better among these two databases. However, every developer should take into account the fact that shifting or transitioning to a new platform will entail challenges and difficulties.

If you ask a developer as to which of the two – Maria vs. MySQL – is faster, they would not give you a direct answer because the answer to this question is still affected by a number of factors.

The answer can depend on the number and types of queries, the use case, the number of connections as well as users, and other factors that are critical to every database. Thus, this guide aims to give you a better understanding of the differences between the two.

Remember, whatever change you may be planning to implement, it is always an essential step to run tests. Whether you are transitioning from one type of database to the other, from MariaDB to MySQL or vice versa, from a particular OS to another one, from the cloud to on-premise servers, always plan your own process of database benchmarking as this can truly make a difference.