HOME

TheInfoList



OR:

RocksDB is a high performance embedded database for key-value data. It is a fork of Google's LevelDB optimized to exploit
multi-core processor A multi-core processor (MCP) is a microprocessor on a single integrated circuit (IC) with two or more separate central processing units (CPUs), called ''cores'' to emphasize their multiplicity (for example, ''dual-core'' or ''quad-core''). Ea ...
s (CPUs), and make efficient use of fast storage, such as solid-state drives (SSD), for
input/output In computing, input/output (I/O, i/o, or informally io or IO) is the communication between an information processing system, such as a computer, and the outside world, such as another computer system, peripherals, or a human operator. Inputs a ...
(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 language bindings for C++, C, and
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
. Many third-party language bindings exist. RocksDB is
free and open-source software Free and open-source software (FOSS) is software available under a license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term encompassing free ...
, 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 The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or copyleft, ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was th ...
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 Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
,
Yahoo! Yahoo (, styled yahoo''!'' in its logo) is an American web portal that provides the search engine Yahoo Search and related services including My Yahoo, Yahoo Mail, Yahoo News, Yahoo Finance, Yahoo Sports, y!entertainment, yahoo!life, and its a ...
, and
LinkedIn LinkedIn () is an American business and employment-oriented Social networking service, social network. It was launched on May 5, 2003 by Reid Hoffman and Eric Ly. Since December 2016, LinkedIn has been a wholly owned subsidiary of Microsoft. ...
.


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 *
Backup In information technology, a backup, or data backup is a copy of computer data taken and stored elsewhere so that it may be used to restore the original after a data loss event. The verb form, referring to the process of doing so, is "wikt:back ...
s and snapshots * Column families * Bloom filters * Time to live (TTL) support * Universal compaction * Merge operators * Statistics collection * Geospatial indexing and others. RocksDB is not an SQL database (although MyRocks combines RocksDB with
MySQL MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
). Like other
NoSQL NoSQL (originally meaning "Not only SQL" or "non-relational") refers to a type of database design that stores and retrieves data differently from the traditional table-based structure of relational databases. Unlike relational databases, which ...
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 A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
, as it provides no server or
command-line interface A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
.


History

RocksDB was created at
Facebook Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
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 In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
management system (DBMS). 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

ArangoDB has added RocksDB to its previous storage engine ("mmfiles"). RocksDB is be the default storage engine since ArangoDB 3.4.


Cassandra

Cassandra Cassandra or Kassandra (; , , sometimes referred to as Alexandra; ) in Greek mythology was a Trojan priestess dedicated to the god Apollo and fated by him to utter true prophecy, prophecies but never to be believed. In modern usage her name is e ...
on RocksDB can improve the performance of Apache Cassandra significantly (3–4 times faster in general, 100 times faster in some use-cases). The Instagram team at Facebook developed and open-sourced their code, along with benchmarks of their performance results.


MariaDB

MariaDB MariaDB is a community-developed, commercially supported Fork (software development), fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Developm ...
can use the MyRocks storage engine (which is forked from RocksDB) since MariaDB 10.2.5 (Alpha status) and stable since MariaDB 10.2.16 in 2018.


MongoDB

The MongoRocks project provides a storage module for
MongoDB MongoDB is a source-available, cross-platform, document-oriented database program. Classified as a NoSQL database product, MongoDB uses JSON-like documents with optional database schema, schemas. Released in February 2009 by 10gen (now 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 created a new RocksDB-based storage engine for
MySQL MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
. In-depth details about MyRocks were presented at Percona Live 2016.


Oxigraph

Oxigraph is a
graph database A graph database (GDB) is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. A key concept of the system is the graph (or edge or relationship). The graph relates the dat ...
implementing the SPARQL standard, based on RocksDB


UKV

The UKV project allows users to use RocksDB on par with LevelDB as the underlying key-value store. It represents a shared abstraction for create, read, update and delete (CRUD) operations common to every storage engine. It augments it with structured bindings for several high-level languages, including Python,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, and Go.


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.


Kafka Streams

Kafka Streams uses RocksDB for its state stores.


Manhattan

The Manhattan Distributed Key-Value Store has used RocksDB as its primary engine to store Twitter data since 2018.


Rockset

The Rockset 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.


YugabyteDB

The YugabyteDB database uses a modified version of RocksDB as part of its DocDB storage engine.


Third-party language bindings

Third-party programming language bindings available for RocksDB include: * C * C# * Chicken Scheme * D *
Elixir An elixir is a sweet liquid used for medical purposes, to be taken orally and intended to cure one's illness. When used as a dosage form, pharmaceutical preparation, an elixir contains at least one active ingredient designed to be taken orall ...
* Erlang * Go *
Haskell Haskell () is a general-purpose, statically typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell pioneered several programming language ...
*
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
* Kotlin * Node.js * Nim *
Objective-C Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was ...
, and
Swift Swift or SWIFT most commonly refers to: * SWIFT, an international organization facilitating transactions between banks ** SWIFT code * Swift (programming language) * Swift (bird), a family of birds It may also refer to: Organizations * SWIF ...
*
OCaml OCaml ( , formerly Objective Caml) is a General-purpose programming language, general-purpose, High-level programming language, high-level, Comparison of multi-paradigm programming languages, multi-paradigm programming language which extends the ...
*
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
* PHP *
Prolog Prolog is a logic programming language that has its origins in artificial intelligence, automated theorem proving, and computational linguistics. Prolog has its roots in first-order logic, a formal logic. Unlike many other programming language ...
* Python *
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
*
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH) ...


References


External links

* {{Meta Platforms Bigtable implementations NoSQL Database engines Embedded databases C++ libraries Facebook software Key-value databases Ordered Key-Value Store