MySQL Conf 2008 – Maria Engine (Day 3)

Author Michael Tougeron on April 17, 2008

Posted under Events, mysql and tagged with , , , ,

Wednesday afternoon Monty went through the Architecture of Maria, what the new features are and what its roadmap will be. For those of you who are not aware of Maria, it is a new db engine that Monty announced back in January.

Maria was designed to be a crash-safe replacement for MyISAM. Maria supports the same row formats and features as MyISAM. This means it can be fully compatible with MyISAM by simply running it in non-transactional control. It will be ACID compliant and have multi-version concurrency control (MVCC).

Version 1.0 of Maria was released in January as a branch of MySQL. It will continue to be a branch until version 2.0 where it will hopefully be part of MySQL 6.  Customized documentation is also available on http://dev.mysql.com/doc/refman/5.1-maria/en/se-maria.html.

Version 1.5 of Maria should be released any week now. Monty had originally hoped to announce it this week at the conference, but it is not quite done yet. He says that it should be out sometime between Late April to mid-May. Starting with version 1.5, Maria will support concurrent INSERT and SELECT operation. This will give Maria a nice feature merge between InnoDB and MyISAM.

Starting with MySQL 6 in Q4 of 2008, version 2 of Maria will be fully transactional and ACID compliant. Having the crash recovery will be a great thing to have with the read speed of MyISAM. Version 3 will be optimized for higher concurrency.

With the expected small footprint and the efficient data storage model, Maria will be a good engine of choice for desktop applications or embedding in applications.

The way in which Maria is crash-safe is kind of interesting. It stores everything except table definitions into log files. While these log files can be quite large, starting size is 1GB, it creates a few cool features. With MyISAM tables, you can apply a lock to the db (or shutdown the server) and then copy the data to a new server. With Maria, you can simply copy the data and the logs to the new server. Like with MyISAM, the new server will have corrupted tables. Unlike MyISAM, Maria will then run through the logs and recover the db to where it should be. Or, if you don’t like that method, you can take last night’s backup to the new server, copy just today’s logs from the donor server and start up MySQL. Maria will take the data from the backup and then automatically apply the logs until the new server is up-to-date.

There is quite a list of features that are either already in Maria or will be by the time version 3 comes out.

  • MVCC & ACID
  • Equal lookup speed for all indexes
  • Allows easy copying of tables and/or Maria logs
  • Has instant COUNT(*) queries
  • Better BLOG handling than MyISAM
  • Versioned
  • Crash safe
  • Data stored in 8k pages for less locking and improved query performance

By using 8k pages Maria will be faster on static size indexes than MyISAM, but slower on variable length keys. Updates that are planned for version 2 or 3 will make variable length indexes just as fast.

There are a few disadvantages of Maria over MyISAm.

  • No INSERT DELAYED (may or may not eventually be added)
  • Fulltext indexes are not yet crash-safe (planned to be fixed in version 3)
  • No external locking
  • Like MyISAM it will not support RAID
  • When using checksums, the data size will be slightly larger for indexes
  • Storage of very small rows (<25 bytes) are not efficient with the new page format

All in all, I’m pretty excited about where they are going with Maria. While some of the databases I use are write heavy the vaste majority are primarily reads; there are only so many news stories a day. I looks like Maria will give us the stability and locking abilities of InnoDB while keeping the speed of MyISAM reads.

Posted under Events, mysql

This post was written by Michael Tougeron on April 17, 2008

Tags: , , , ,

Leave a Comment

You must be logged in to post a comment.

More Blog Posts