Facebook rocks an open source storage engine for MySQL

Facebook's speedy and compact RocksDB key-value store for MySQL is now open source, but watch out for its limited feature set

Facebook rocks an open source storage engine for MySQL
flickr/Pascal (Creative Commons BY or BY-SA)

Facebook's RocksDB key-value store has found its way into a number of third-party products, like the Apache Flink big-data processing framework and MongoDB. Now it's taking up residence in a familiar neighborhood: MySQL.

MyRocks implements RocksDB as an open source storage engine for MySQL. Now any MySQL application -- or MySQL-compatible query -- can use a high-speed storage system that's been optimized to work well with the peculiarities of flash storage.

In a blog post from yesterday, Facebook database engineer Yoshinori Matsunobu discussed the advantages of pairing up the two. MySQL is well-understood and highly automatable; data placed in it can be easily accessed, backed up, partitioned, and replicated. By making RocksDB into a MySQL storage engine, RocksDB gains all of those functionalities automatically.

In Facebook's estimation, RocksDB has several functional advantages over MySQL's default InnoDB storage engine. Data in RocksDB uses less overall I/O per read or update, so it puts less strain on flash storage's write endurance. It can also be more readily compressed, defragmented, replicated, and accessed.

Before you rip out InnoDB and replace it with MyRocks on your own MySQL deployments, hold your horses. For one, there's a lot MyRocks can't do yet -- it doesn't support foreign keys, for instance, which is likely to be a deal-killer for many kinds of database applications. Full-text indexing isn't supported either.

Another possible issue: MyRocks is currently available only via a fork of MySQL 5.6. It's not clear that the MyRocks storage engine can be installed by itself in an existing, conventional MySQL 5.6 deployment. The fact that MyRocks is open source eases its implementation, but it's not guaranteed.

It's not immediately apparent if Facebook needs any of the above features -- Facebook isn't planning to replace all of its InnoDB instances with MyRocks anyway. "InnoDB is a long-standing standard MySQL storage engine and has many different use cases," said Matsunobu. "There are [many] critical database tiers [inside Facebook], and we’ll continue to use InnoDB for most of them."

Copyright © 2016 IDG Communications, Inc.

How to choose a low-code development platform