
The original developers of MySQL created MariaDB in 2009. As time passed, MariaDB replaced MySQL in many places. MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL.
The goal for Maria-DB is to be a drop-in replacement for MySQL – with more features and better performance. MariaDB is based on the corresponding version of MySQL, if one exists. For example, MariaDB 5.1.53 is based on MySQL 5.1.53, with some added bug fixes, additional storage engines, new features, and performance improvements. Versions of MariaDB that do not have an equivalently numbered version of MySQL (e.g., MariaDB 5.2.4) contain major new features the developers felt warranted a new version number. When comparing the two here, I’ll focus on the additional features of MariaDB.
At Hoffensoft, we migrated all of our own databases from MySQL to MariaDB.
Why MariaDB?
MariaDB on the other hand is developed fully in the open: all development decisions can be reviewed and debated on a public mailing list of in the public bug tracker. Contributing to MariaDB with patches is easy and patch flow is transparent in the fully public and up-to-date code repository.
MariaDB however follows good industry standards by releasing security announcements and upgrades at the same time and handling the pre-secrecy and post-transparency in a proper way.
MariaDB in particular excels as the amount of storage engines and other plugins it ships with: Connect and Cassandra storage engines for NoSQL backends or rolling migrations from legacy databases, Spider for sharding, TokuDB with fractal indexes etc. In MariaDB these plugins are part of the official release, which guarantees that the plugins are well integrated and easy to use.
MariaDB claims it has a much improved query optimizer and many other performance related improvements. Certain benchmarks show that MariaDB is radically faster than MySQL.
MariaDB Galera Cluster is a new kind of clustering engine which, unlike traditional MySQL master-slave replication, provides master-master replication and thus enables a new kind of scalability architecture for MySQL/MariaDB. Itis a synchronous multi-master cluster for MariaDB. It is available on Linux only, and only supports the XtraDB/InnoDB storage engines.
Differences and Features
The most visible change, at least to users of the mysql client application is purely cosmetic: The command prompt has been altered to be more informative by indicating whether you are connected to a MariaDB or MySQL database, and it displays the name of the database you are connected to. Because of the special attention given by the MariaDB developers to maintain compatibility with MySQL, either client application can connect to either database.
The next most visible change are the additional storage engines that ship with MariaDB. These include the Aria, XtraDB (an enhanced and extended version of the InnoDB storage engine), PBXT, FederatedX (a drop-in replacement for Federated), OQGraph, and SphinxSE storage engines. All of these are available for MySQL; however, to use them, you need to compile or install them yourself. With MariaDB, they are part of the default install. All of the standard storage engines in MySQL (MyISAM, blackhole, CSV, Memory, etc.) are included in MariaDB.
The INFORMATION_SCHEMA has also been enhanced. MariaDB has added more data in various tables.
The INFORMATION_SCHEMA.PROCESSLIST table has been given a new column, TIME_MS. This column provides the same information as the column TIME, but in units of milliseconds with microsecond precision. The slow query log has also been improved. In MariaDB, you can set the verbosity, filter out queries you don’t want logged, and limit the logging rate. As with other new features, the default configuration has this extra functionality turned off to be compatible with the behavior of MySQL.
Other changes in MariaDB are not so visible, but they help to improve performance, give MariaDB more flexibility, or both.
The table elimination feature in MariaDB is designed to detect when a query will not use certain tables and eliminate them from the query plan. The performance increase this provides can be dramatic. One new feature in MariaDB that adds flexibility is virtual columns, which are columns that are calculated and updated “on the fly.” An early version of this feature was contributed to MySQL back in 2008 by Andrey Zhakov, but it never found its way into a stable release of MySQL.
Other new features in MariaDB have been made to make the code more modular and prepare for future development. MariaDB now has a standard way for storage engines to extend the CREATE table statement that keeps the storage engine code isolated and independent. Now, new storage engines can be included earlier in development because, if you choose not to use it, there is no effect.
All of the above features and others are described in greater detail in the MariaDB Knowledgebase.