LevelDB is an open-source on-disk key-value store written by Google fellows Jeffrey Dean and Sanjay Ghemawat and it is inspired by Bigtable. It is based on a log-structured merge-tree (LSM tree) data structure.

RocksDB is developed and maintained by Facebook Database Engineering Team. It is built on earlier work on LevelDB.
This code is a library that forms the core building block for a fast key-value server, especially suited for storing data on flash drives. It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF) and Space-Amplification-Factor (SAF).
It has multi-threaded compactions, making it especially suitable for storing multiple terabytes of data in a single database.

Features of LevelDB :

  • Keys and values are arbitrary byte arrays.
  • Data is stored sorted by key.
  • Callers can provide a custom comparison function to override the sort order.
  • The basic operations are Put(key,value)Get(key)Delete(key).
  • Multiple changes can be made in one atomic batch.
  • Users can create a transient snapshot to get a consistent view of data.
  • Forward and backward iteration is supported over the data.
  • Data is automatically compressed using the Snappy compression library.
  • External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions.

Features of RocksDB:

RocksDB provides all of the features of LevelDB, plus:
  • Transactions
  • Backups and snapshots
  • Column families
  • Bloom filters
  • Time to live (TTL) support
  • Universal compaction
  • Merge operators
  • Statistics collection
  • Geospatial indexing

Comparison of LevelDB and RocksDB:

Developed by GoogleDeveloped by Facebook
Open SourceOpen Source
Key-Value Store Key-Value Store
Built in C++Built in C++
No TransactionsTransactions are supported.
Concurrency supportedConcurrency supported.
NodeJs,Python,Java C++,Go Api available to access the LevelDBC++ and Java Api available.

Benchmarking :


Here are the results of a run on 100 million values spread out over 500k columns:

Source: https://www.influxdata.com/blog/benchmarking-leveldb-vs-rocksdb-vs-hyperleveldb-vs-lmdb-performance-for-influxdb/

Overall it looks like RocksDB might be the best choice compare to LevelDB.

That’s all I have and thanks a lot for reading. Please let me know if any corrections/suggestions. Please do share and comments if you like the post. Thanks in advance… 😉


Leave a Reply

Your email address will not be published. Required fields are marked *

Insert math as
Additional settings
Formula color
Text color
Type math using LaTeX
Nothing to preview