There has been a lot of discussion about MariaDB 10.0 throughout the whole year. When will it be released, what will it include, what is the focus on MariaDB going forward, etc? My feeling is that people have in the past few months started to understand the value of MariaDB 10.0. There is a good group of people and companies that have been trying out and using the MariaDB 10.0 alpha releases and providing us with excellent feedback.
MariaDB 10.0 is a massive release with loads of new features which ease several pain points that MariaDB and MySQL users have run into over the years.
The highlights of MariaDB 10.0 can be divided into the following areas:
- Replication enhancements
- Storage engines
- Optimizer enhancements
- Administration improvements
- Other important new features
- Merged features and functionality from MySQL 5.6
I’ll go through each of these areas briefly to give an overview on what they include.
Global Transaction Id – In replication, MariaDB 10.0 introduces a new building block, Global Transaction Id(GTID). The implementation is different from the corresponding functionality in MySQL 5.6 and the main goals of the implementation have been 1) make it easy to set up replication with GTID and easily provision new slaves and 2) support other replication features such as Multi-Source Replication (see below). The introduction of GTID also makes the slaves crash safe, which they haven’t been before.
Multi-Source Replication – With Multi-source replication, contributed by Lixun Peng and Taobao you can replicate data from many masters to one slave. This is very useful when you have sharded your data and want a complete copy of it on one server. For this very reason Tumblr, the microblogging site, nowadays part of Yahoo! is already using this feature. Check out the story.
Parallel Slave (sponsored by Google) – Finally, MariaDB 10.0 solves a long lasting replication challenge that even exists in MySQL 5.6. Until now, with enough writes (INSERT/UPDATE) happening on a master the slaves would not be able to keep up at the same pace and they would lag behind. With the parallel slave feature in 10.0 this challenge is now gone. The slaves will adapt to the speed of the master and apply binlog events in parallel. Transactions will be applied in parallel if they were executed in parallel on the master. Unlike MySQL 5.6, the transactions can concern the same database or even the same table.
Many storage engine developers have been actively engaging with the developers of MariaDB lately and as a result there are several new storage engines in MariaDB 10.0 (in alphabetical order):
- Cassandra Storage Engine: Combine data from Cassandra with your data in MariaDB, read and write Cassandra data, and connect many MariaDB servers to one Cassandra ring, creating a high-availability cluster.
- Connect Storage Engine: Use Connect to handle data in files or behind ODBC as if that data was part of the data stored in MariaDB. Developed and contributed by Olivier Bertrand.
- Sequence Storage Engine: Create numerical sequences that are stored in memory and can be used in your queries. For some use case examples check this article.
- Spider Storage Engine: A storage engine with built in sharding capabilities. Developed and contributed by Kentoku Shiba.
- TokuDB: A storage engine designed for high performance write-intensive workloads. Developed and contributed by Tokutek.
Engine Independent Persistent Statistics – Statistics are now provided separately from storage engines. Before, statistics were supplied by the storage engines themselves and the quality of the statistics were usually quite poor. Also the storage engine interface puts a lot of restrictions on them. Statistics are used by the query optimizer to choose the best execution plan for each SQL statement. Better statistics results in better execution plans and end users will experience faster results in general.
Histograms – To improve query optimization, MariaDB 10.0 introduces histograms. Histograms can be collected for both indexed and non indexed columns. Histogram data allows the query optimizer to make better query plan choices for complex multi-table queries.
Optimizations for EXISTS subqueries – the optimizer will convert EXISTS subqueries to IN, when possible. This conversion allows the usage of semi-join optimizations or Materialization optimization for certain classes of EXISTS subqueries.
10.0 includes a set of features that make the life of DBAs easier:
- Roles – This is a big thing! Long awaited roles are introduced in MariaDB. DBAs can now create roles with certain permissions and assign users to the roles. Thanks to Google Summer of Code and developer Vicențiu Ciorbaru!
- SHOW EXPLAIN – get the query plan of a running statement.
- EXPLAIN in the Slow Query Log – write EXPLAIN output into the slow query log.
- EXPLAIN INSERT/UPDATE/DELETE – EXPLAIN for INSERT/UPDATE/DELETE has been added in the same way as in MySQL 5.6, but the implementation is different.
- SHOW PLUGIN SONAME – list all plugins despite them being installed or not.
- SHUTDOWN – Finally use SQL to SHUTDOWN the server
- KILL QUERY ID – Kill a specific query with its id, not the thread id (solves a nasty race condition).
- Per-connection memory usage – List each connection with amount of memory used
OTHER IMPORTANT NEW FEATURES
There are also a bunch of new interesting features that don’t fall into the above categories:
New REGEXP – The switch to the modern regexp library PCRE together with the new SQL
functions REGEXP_REPLACE, REGEXP_SUBSTR, REGEXP_INSTR improve MariaDB text processing capabilities drastically. Developed during Google Summer of Code by Sudheera Palihakkara.
DELETE … RETURNING – Many users asked for the possibility for the DELETE statement to return the deleted rows in a resultset. It’s now possible by adding RETURNING at the end of the statement.
ALTER … IF [NOT] EXISTS – In your ALTER statements you can now add the IF or IF NOT keywords to e.g. add a column or create an index if it does or does not exist from before.
Named Dynamic Columns – In earlier versions of MariaDB Dynamic Columns, which allows for a different number of columns in each row, columns could only be referred to by number. Now the columns can be referred to by name.
Multiple GET_LOCK() – The use of many user level locks is now supported. Developed and contributed by Konstantin Osipov.
MERGED FROM MYSQL 5.6
Selected pieces of MySQL 5.6 have been merged into MariaDB 10.0. The main ones are:
- InnoDB – Most InnoDB enhancements are now in MariaDB 10.0.
- Performance Schema – The full new performance schema with all the new event filtering, instrumentation, and other goodies.
- Online ALTER – Do many of your schema changes without interrupting the system
- Filesort optimization for queries using the ORDER BY … LIMIT optimization – A useful optimization for showing only a few rows of a bigger result set.
- Privileges for CREATE TEMPORARY TABLES
- Character set extensions
- GET DIAGNOSTICS
- TO_BASE64(), FROM_BASE64
Obviously there exist many smaller enhancements in MariaDB 10.0 and other things merged from 5.6, but the above overview of new features and merges includes the biggest ones.
As you can see, the community has been very active in contributing to 10.0 and it’s absolutely fantastic to be able to have all these new features pulled together into MariaDB and having them available to all MariaDB 10.0 users by default. A big thank you to all contributors!
Go give it a try and download the MariaDB 10.0.5 Beta!
If you’re excited about MariaDB 10.0 and its features or MariaDB in general and have a great MariaDB story to share, about some interesting use of MariaDB or some specific feature you love, please let us know.
PS. If you are attending Percona Live in London make sure you come and celebrate the launch of the MariaDB 10.0 beta with us over a drink or two on Mon 11th Nov. More info here.