RocksDB is a high performance embedded database for key-value data. It is a fork of LevelDB which was then optimized to exploit many central processing unit (CPU) cores, and make efficient use of fast storage, such as solid-state drives (SSD), for input/output (I/O) bound workloads. It is based on a log-structured merge-tree (LSM tree) data structure. It is written in C++ and provides official application programming interface (API) language bindings for C++, C, and Java; alongside many 3rd-party language bindings. RocksDB is open-source software, released under a BSD 3-clause license.
RocksDB is used in production systems at various web-scale enterprises including Facebook, Yahoo!, and LinkedIn.
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:Column Families
Time to Live (TTL) support
RocksDB is not an SQL database (although MyRocks combines RocksDB with MySQL). 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.
RocksDB was begun at Facebook by Dhruba Borthakur in April 2012, as a fork of LevelDB with the initial stated goal of improving performance for server workloads.
As an embeddable database, RocksDB can be used as a storage engine within a larger database management system (DBMS). For example, CockroachDB uses RocksDB as its storage engine.
The following projects have been started to replace or offer an alternative storage engines for already-established database systems with RocksDB:
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.
The MyRocks project creates a new RocksDB based storage engine for MySQL. In-depth details about MyRocks were presented at Percona Live 2016.
The TiDB NewSQL distributed database which is marketed as a compatible alternative to MySQL, has a number of pluggable backends including RocksDB.
The following database systems have chosen to use RocksDB as their embedded storage engine:
The Dgraph project uses RocksDB as the storage engine for the Dgraph NoSQLGraph Database.
The ssdb-rocks project uses RocksDB as the storage engine for the SSDB NoSQL Database.
3rd-party programming language bindings available for RocksDB, include:C# - https://github.com/warrenfalk/rocksdb-sharp
Go - https://github.com/tecbot/gorocksdb
Haskell - https://hackage.haskell.org/package/rocksdb-haskell
Node.js - https://npmjs.org/package/rocksdb
Erlang - https://github.com/leo-project/erocksdb
Objective-C, and Swift - https://github.com/iabudiab/ObjectiveRocks
Perl - https://metacpan.org/pod/RocksDB
Python - https://github.com/stephan-hof/pyrocksdb
PHP - https://github.com/Photonios/rocksdb-php
Ruby - http://rubygems.org/gems/rocksdb-ruby
Rust - https://github.com/spacejam/rust-rocksdb