RocksDB
RocksDB is a high performance embedded database for key-value data. It is a fork of Google's LevelDB optimized to exploit multi-core processors, 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 language bindings for C++, C, and Java. Many [|third-party language bindings] exist. RocksDB is free and open-source software, released originally 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. This change helped its adoption in Apache Software Foundation's projects after 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:
- Transactions
- Backups and snapshots
- Column families
- Bloom filters
- Time to live support
- Universal compaction
- Merge operators
- Statistics collection
- Geospatial indexing
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 provides no 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, Rockset uses RocksDB mostly for analytical data processing.Alternative backend
The following projects have been started to replace or offer alternative storage engines for already-established database systems with RocksDB:ArangoDB
has added RocksDB to its previous storage engine. RocksDB is be the default storage engine since ArangoDB 3.4.Cassandra
The Instagram team at Facebook developed and open-sourced their code, along with benchmarks of their performance results.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.