For many years, MySQL was the leader of the pack when it came to open source relational databases. In recent years, however, the MySQL fork, MariaDB, has been making significant headway and some big sites – including Wikipedia – have made or are in the process of making the switch.
MySQL was created by the Finnish developer Michael “Monty” Widenius and David Axmark and released under the GPL and various commercial licenses. The database was originally developed under the auspices of MySQL, AB but in 2008 that company was sold to Sun Microsystems, which was itself acquired by Oracle Corporation, the developers of a popular and closed source competitor to MySQL.
MySQL is by far the most popular open source relational database platform. After being dissatisfied with the way development was heading under Sun, however, Widenius forked MySQL and created MariaDB. The purchase by Oracle further cemented the impression that MySQL was not in safe hands because of a perceived conflict of interest between MySQL and Oracle’s commercial database products.
MariaDB was intended as a drop-in, fully compatible replacement for MySQL, with each version of MariaDB implementing all of the features of its equivalent MySQL version. However, because patches and new features have been incorporated into MariaDB more quickly than MySQL, as things stand, MariaDB has made some significant performance and feature advances. In versions before the 10.x release, users could be certain that everything MySQL did, equivalent versions of MariaDB did too, but that reverse was not always true. In the future, MariaDB is likely to diverge more rapidly from MySQL.
Features that were implemented in MariaDB, but not MySQL, included:
The Aria Storage engine, which enabled faster complex queries.
Virtual columns, which allow for on-the-fly calculation and updating of columns.
Table elimination for removing unnecessary table access for queries that reference a table but don’t require it to be accessed.
Various other performance optimizations.
The other significant difference between the two is that MySQL is susceptible to the whims of Oracle, while MariaDB is a community-managed project overseen by Widenius.
A number of large sites have changed to MariaDB from MySQL or are in the process of doing so, including Wikipedia. Wikimedia Site Architect, Asher Feldman, said of the change:
“Taking the times of 100% of all queries over regular sample windows, the average query time across all enwiki slave queries is about 8% faster with MariaDB vs. our production build of 5.1-fb. Some queries types are 10-15% faster, some are 3% slower, and nothing looks aberrant beyond those bounds. Overall throughput as measured by qps queries per second has generally been improved by 2-10%. “
Of course, the performance increases depend heavily on how the database is used, so your mileage may vary considerably.
Ultimately, making the decision to switch should be based on whether the performance and feature enhancements are worth the effort of the change (which isn’t difficult to do), and whether the licensing issues are a problem. Users of Oracle’s support services have no choice, as Oracle doesn’t support MariaDB, but otherwise a simple cost / benefit analysis and consideration of the likely future development of the two platforms probably favors MariaDB.
Have you or are you thinking about making the switch? If so, why? Join the conversation in the comments below.