Software:RocksDB

From HandWiki
Short description: Embedded key-value database
RocksDB
Rocksdb-icon.svg
Original author(s)Dhruba Borthakur
Developer(s)Meta Platforms (was Facebook, Inc.)
Initial releaseMay 2012; 12 years ago (2012-05)
Written inC++
Operating systemWindows, macOS, Linux, FreeBSD, OpenBSD, Solaris, AIX
PlatformCross-platform
TypeEmbedded database
LicenseApache 2.0 or GPL 2
Websiterocksdb.org

RocksDB is a high performance[1][2][3][4][5] embedded database for key-value data. It is a fork of Google's LevelDB optimized to exploit multi-core processors (CPUs), 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 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.[6][7][8] However, in July 2017 the project was migrated to a dual license of both Apache 2.0 and GPLv2 license.[9] This change helped its adoption in Apache Software Foundation's projects after blacklist of the previous BSD+Patents license clause.[10][11]

RocksDB is used in production systems at various web-scale enterprises[12] including Facebook, Yahoo!,[13] and LinkedIn.[14]

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: List of RocksDB features that are not in LevelDB.

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 provides no server or command-line interface.

History

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

Integration

As an embeddable database, RocksDB can be used as a storage engine within a larger database management system (DBMS). For example, Rockset uses RocksDB[29] 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").[30] Starting with ArangoDB 3.4, RocksDB will be the default storage engine in ArangoDB.[31]

Cassandra

Cassandra on RocksDB can improve the performance of Apache Cassandra significantly (3-4 times faster in general, 100 times faster in some use-cases).[citation needed] The Instagram team at Facebook developed and open-sourced their code, along with benchmarks of their performance results.[32]

MariaDB

MariaDB can use the MyRocks storage engine (which is forked from RocksDB) since MariaDB 10.2.5 (Alpha status) [33] and stable since MariaDB 10.2.16 in 2018.[34]

MongoDB

The MongoRocks project provides a storage module for MongoDB where the storage engine is RocksDB.[35][36][37]

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.[38]

MySQL

The MyRocks project created a new RocksDB-based storage engine for MySQL.[39][40] In-depth details about MyRocks were presented at Percona Live 2016.[41]

Oxigraph

Oxigraph is a graph database implementing the SPARQL standard, based on RocksDB

UKV

The UKV[42] 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, 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.[43]

Apache Flink

Apache Flink uses RocksDB to store checkpoints.[44]

FusionDB

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

LogDevice LogsDB

LogDevice's LogsDB is built atop RocksDB.[47]

Manhattan

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

Rockset

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

SSDB

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

TiDB

The TiDB[52] project uses RocksDB as its storage engine.[53]

YugabyteDB

The YugabyteDB[54] 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:


References

  1. "Performance Benchmarks". https://github.com/facebook/rocksdb/wiki/Performance-Benchmarks. 
  2. "Benchmarking the leveldb family". 7 July 2014. http://smalldatum.blogspot.com/2014/07/benchmarking-leveldb-family.html. 
  3. "Comparing LevelDB and RocksDB, take 2". 27 April 2015. http://smalldatum.blogspot.com/2015/04/comparing-leveldb-and-rocksdb-take-2.html. 
  4. "Benchmarking LevelDB vs. RocksDB vs. HyperLevelDB vs. LMDB Performance for InfluxDB". 20 June 2014. https://influxdata.com/blog/benchmarking-leveldb-vs-rocksdb-vs-hyperleveldb-vs-lmdb-performance-for-influxdb/. 
  5. Golan-Gueta, Guy; Bortnikov, Edward; Hillel, Eschar; Keidar, Idit (April 21, 2015). "Scaling concurrent log-structured data stores". Proceedings of the Tenth European Conference on Computer Systems. pp. 1–14. doi:10.1145/2741948.2741973. ISBN 9781450332385. 
  6. "Facebook's latest open source effort: a flash-powered database called RocksDB". 21 November 2013. https://gigaom.com/2013/11/21/facebooks-latest-open-source-effort-a-flash-powered-database-called-rocksdb/. 
  7. "Under the Hood: Building and open-sourcing RocksDB". https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-and-open-sourcing-rocksdb/10151822347683920/. 
  8. "RocksDB - Facebook's Database Now Open Source". http://www.i-programmer.info/news/84-database/6624-rocksdb-facebooks-database-now-open-source.html. 
  9. "GitHub pull request". https://github.com/facebook/rocksdb/tree/3c327ac2d0fd50bbd82fe1f1af5de909dad769e6/env. 
  10. "Apache says 'no' to Facebook code libraries". https://www.theregister.co.uk/2017/07/17/apache_says_no_to_facebook_code_libraries/. 
  11. "GitHub issue". https://github.com/facebook/rocksdb/issues/2605. 
  12. "Users.md". https://github.com/facebook/rocksdb/blob/master/USERS.md. 
  13. "RocksDB on Steroids". http://www.i-programmer.info/news/84-database/8542-rocksdb-on-steroids.html. 
  14. "Benchmarking Apache Samza: 1.2 million messages per second on a single node". https://engineering.linkedin.com/performance/benchmarking-apache-samza-12-million-messages-second-single-node. 
  15. "RocksDB transactions". https://github.com/facebook/rocksdb/wiki/Transactions. 
  16. "How to backup RocksDB?". https://github.com/facebook/rocksdb/wiki/How-to-backup-RocksDB. 
  17. "Checkpoints". https://github.com/facebook/rocksdb/wiki/Checkpoints. 
  18. "Column families in RocksDB". https://github.com/facebook/rocksdb/wiki/Column-Families. 
  19. "RocksDB bloom filters". https://github.com/facebook/rocksdb/wiki/RocksDB-Bloom-Filter. 
  20. "RocksDB TTL support". https://github.com/facebook/rocksdb/wiki/Time-to-Live. 
  21. "Universal compaction". https://github.com/facebook/rocksdb/wiki/Universal-Compaction. 
  22. "RocksDB merge operator". https://github.com/facebook/rocksdb/wiki/Merge-Operator-Implementation. 
  23. "RocksDB perf context and IO stats context". https://github.com/facebook/rocksdb/wiki/Perf-Context-and-IO-Stats-Context. 
  24. "Spatial indexing in RocksDB". https://rocksdb.org/blog/2015/07/17/spatial-indexing-in-rocksdb.html. 
  25. "First commit where RocksDB diverges from LevelDB". May 10, 2012. https://github.com/facebook/rocksdb/commit/cc6c32535aec596036c56fe742a39182539f76fa. 
  26. "Rocksdb readme file". Nov 30, 2012. https://github.com/facebook/rocksdb/commit/6eb5ed9a4922ec2d121768adfa3ab3b6ead5d627. 
  27. "The History of RocksDB". November 24, 2013. http://rocksdb.blogspot.com/2013/11/the-history-of-rocksdb.html. 
  28. Borthakur, Dhruba (November 22, 2013). "RocksDB: A High Performance Embedded Key-Value Store for Flash Storage - Data@Scale". https://www.youtube.com/watch?v=V_C-T5S-w8g. "... The story of why we decided to do RocksDB ..." 
  29. Dhoot, Sandeep (2019-06-27). "How We Use RocksDB at Rockset". https://rockset.com/blog/how-we-use-rocksdb-at-rockset/. Retrieved 2023-03-01. 
  30. "Comparing new RocksDB and MMFiles storage engines". https://www.arangodb.com/community-server/rocksdb-storage-engine/. 
  31. "RC1 ArangoDB 3.4 - Whats new?". 6 September 2018. https://www.arangodb.com/2018/09/rc1-arangodb-3-4-whats-new/. 
  32. "Open-sourcing a 10x reduction in Apache Cassandra tail latency". 5 March 2018. https://instagram-engineering.com/open-sourcing-a-10x-reduction-in-apache-cassandra-tail-latency-d64f86b43589. 
  33. "MyRocks". https://mariadb.com/kb/en/library/myrocks/. 
  34. "MariaDB 10.2.16 Release Notes". https://mariadb.com/kb/en/mariadb-10216-release-notes/. 
  35. "mongodb-partners/mongo-rocks". 29 October 2021. https://github.com/mongodb-partners/mongo-rocks. 
  36. "Integrating RocksDB with MongoDB". https://rocksdb.org/blog/2015/04/22/integrating-rocksdb-with-mongodb-2.html. 
  37. "MongoDB + RocksDB at Parse". http://blog.parse.com/announcements/mongodb-rocksdb-parse/. 
  38. "facebookgo/rocks-strata". 31 October 2021. https://github.com/facebookgo/rocks-strata. 
  39. "facebook/mysql-5.6". 2 November 2021. https://github.com/facebook/mysql-5.6. 
  40. "MyRocks: MySQL on RocksDB". https://www.percona.com/live/europe-amsterdam-2015/sites/default/files/slides/MyRocksAtFacebook_201509.pdf. 
  41. "MyRocks Deep Dive". 19 April 2016. http://www.slideshare.net/matsunobu/myrocks-deep-dive/. 
  42. 42.0 42.1 42.2 42.3 42.4 "unum-cloud/ukv". 28 December 2022. https://github.com/unum-cloud/ukv. 
  43. "Storage Devices -- Ceph Documentation". http://docs.ceph.com/docs/luminous/rados/configuration/storage-devices/. 
  44. "Apache Flink 1.8 Documentation: State Backends". https://ci.apache.org/projects/flink/flink-docs-stable/ops/state/state_backends.html#the-rocksdbstatebackend. 
  45. "FusionDB". Evolved Binary. https://fusiondb.com. 
  46. "The Design and Implementation of FusionDB". XML Prague. https://archive.xmlprague.cz/2019/files/xmlprague-2019-proceedings.pdf#page179. 
  47. "LogDevice: a distributed data store for logs". Mark Marchukov, Facebook. 31 August 2017. https://code.facebook.com/posts/357056558062811/logdevice-a-distributed-data-store-for-logs/. 
  48. "Adopting RocksDB within Manhattan". 28 December 2022. https://blog.twitter.com/engineering/en_us/topics/infrastructure/2021/adopting-rocksdb-within-manhattan. 
  49. "How we use RocksDB at Rockset" (in en). https://rockset.com/blog/how-we-use-rocksdb-at-rockset/. 
  50. "ideawu/ssdb-rocks". 21 August 2021. https://github.com/ideawu/ssdb-rocks. 
  51. https://ssdb.io
  52. "pingcap/tidb". 4 November 2021. https://github.com/pingcap/tidb. 
  53. "TiDB Internal (I) - Data Storage". Shen Li. 11 July 2017. https://pingcap.com/blog/2017-07-11-tidbinternal1. 
  54. "How We Built a High Performance Document Store on RocksDB?". 20 February 2019. https://blog.yugabyte.com/how-we-built-a-high-performance-document-store-on-rocksdb/. 
  55. "warrenfalk/rocksdb-sharp". 28 September 2021. https://github.com/warrenfalk/rocksdb-sharp. 
  56. "chicken-rocksdb". http://wiki.call-cc.org/eggref/5/rocksdb. 
  57. "b1naryth1ef/rocksdb". 22 October 2019. https://github.com/b1naryth1ef/rocksdb. 
  58. "urbint/rox". September 2021. https://github.com/urbint/rox. 
  59. "leo-project/erocksdb". September 2021. https://github.com/leo-project/erocksdb. 
  60. "barrel-db/erlang-rocksdb". https://gitlab.com/barrel-db/erlang-rocksdb. 
  61. "tecbot/gorocksdb". 29 October 2021. https://github.com/tecbot/gorocksdb. 
  62. "rocksdb-haskell: Haskell bindings to RocksDB". https://hackage.haskell.org/package/rocksdb-haskell. 
  63. "RocksJava". https://github.com/facebook/rocksdb/wiki/RocksJava-Basics. 
  64. "rocksdb". 25 March 2022. https://npmjs.org/package/rocksdb. 
  65. "rocksdb". https://github.com/status-im/nim-rocksdb. 
  66. "iabudiab/ObjectiveRocks". 2 August 2021. https://github.com/iabudiab/ObjectiveRocks. 
  67. "OCaml bindings for RocksDB". 8 October 2021. https://github.com/ahrefs/ocaml-ahrocksdb. 
  68. "An OCaml RocksDb binding using ocaml-ctypes". 28 September 2020. https://github.com/domsj/orocksdb. 
  69. "RocksDB - Perl extension for RocksDB - metacpan.org". https://metacpan.org/pod/RocksDB. 
  70. "Photonios/rocksdb-php". 11 August 2021. https://github.com/Photonios/rocksdb-php. 
  71. "SWI-Prolog interface for RocksDB". http://www.swi-prolog.org/pack/list?p=rocksdb. 
  72. "stephan-hof/pyrocksdb". 27 October 2021. https://github.com/stephan-hof/pyrocksdb. 
  73. "rocksdb-ruby - RubyGems.org - your community gem host". http://rubygems.org/gems/rocksdb-ruby. 
  74. "spacejam/rust-rocksdb". 2 November 2021. https://github.com/spacejam/rust-rocksdb. 

External links