RocksDB


RocksDB is a high performance embedded database for key-value data. It is a fork of Google's LevelDB optimized to exploit many central processing unit cores, and make efficient use of fast storage, such as solid-state drives, for input/output bound workloads. It is based on a log-structured merge-tree data structure. It is written in C++ and provides official application programming interface language bindings for C++, C, and Java; alongside many [|third-party language bindings]. RocksDB is open-source software, and was originally released under a BSD 3-clause license. However, in July 2017 the project was migrated to a dual license of both Apache 2.0 and GPLv2 license, possibly in response to the Apache Software Foundation's blacklist of the previous BSD+Patents license clause.
RocksDB is used in production systems at various web-scale enterprises including Facebook, Yahoo!, and LinkedIn.

Features

RocksDB, like LevelDB, stores keys and values in arbitrary byte arrays, and data is sorted byte-wise by key or by providing a custom comparator.
RocksDB provides all of the features of LevelDB, plus:
and others: .
RocksDB is not an SQL database. Like other NoSQL and dbm stores, it has no relational data model, and it does not support SQL queries. Also, it has no direct support for secondary indexes, however a user may build their own internally using Column Families or externally. Applications use RocksDB as a library, as it does not provide a server or command-line interface.

History

RocksDB was created at Facebook by Dhruba Borthakur in April 2012, as a fork of LevelDB with the initial stated goal of improving performance for server workloads.

Integration

As an embeddable database, RocksDB can be used as a storage engine within a larger database management system. For example, CockroachDB uses RocksDB as its storage engine, mostly for transactional workloads while uses RocksDB mostly for analytical data processing. This shows that RocksDB can be used as a storage engine for both Online transaction processing and Online analytical processing.

Alternative backend

The following projects have been started to replace or offer an alternative storage engines for already-established database systems with RocksDB:

ArangoDB

has added RocksDB to its previous storage engine. Starting with ArangoDB 3.4, RocksDB will be the default storage engine in ArangoDB.

Cassandra

Cassandra on RocksDB can improve the performance of Apache Cassandra significantly. The Instagram team at Facebook developed and open-sourced their code, along with benchmarks of their performance results.

MariaDB

MariaDB can use the MyRocks storage engine since MariaDB 10.2.5 and stable since MariaDB 10.2.16 in 2018.

MongoDB

The MongoRocks project provides a storage module for MongoDB where the storage engine is RocksDB.
A related program is Rocks Strata, a tool written in Go, which allows managing incremental backups of MongoDB when RocksDB is used as the storage engine.

MySQL

The MyRocks project creates a new RocksDB based storage engine for MySQL. In-depth details about MyRocks were presented at Percona Live 2016.

Embedded

The following database systems and applications have chosen to use RocksDB as their embedded storage engine:

Ceph's BlueStore

The Ceph's BlueStore storage layer uses RocksDB for metadata management in OSD devices.

Apache Flink

Apache Flink uses RocksDB to store checkpoints.

FusionDB

FusionDB uses RocksDB as its storage engine for XML, Key/Value, and JSON.

LogDevice LogsDB

LogDevice's LogsDB is built atop RocksDB.

Rockset

The service that is used for operational data analytics uses RocksDB as its storage engine.

SSDB

The ssdb-rocks project uses RocksDB as the storage engine for the SSDB NoSQL Database.

TiDB

The TiDB project uses RocksDB as its storage engine.

Third-party language bindings

Third-party programming language bindings available for RocksDB include: