RocksDB

active

by Meta · since 2013

Meta's embeddable LSM-tree key-value engine, the storage layer under dozens of databases.

key-valueembedded libraryopen source (permissive)mature

Overview

RocksDB is a C++ library for persistent, ordered key-value storage built on a log-structured merge tree and tuned for fast SSDs. Meta forked it from LevelDB in 2012 to add multi-threaded compaction, column families, transactions, rich tuning options and much better write throughput, and it has since become the default building block for storage engines: MyRocks, TiKV, Kafka Streams and Flink state, CockroachDB before Pebble, and many more. It is not a server; you embed it and own the API on top. Expect a large configuration surface, and budget time to understand compaction styles and write amplification.

Strengths & trade-offs

Strengths

  • +High write throughput from an LSM design with parallel compaction
  • +Column families, merge operators, compaction filters and prefix bloom filters
  • +Optimistic and pessimistic transactions with snapshots
  • +Huge production footprint at Meta and inside many databases
  • +Extensive tuning knobs for leveled, universal and FIFO compaction

Trade-offs

  • −Very large configuration surface; defaults rarely fit demanding workloads
  • −Write and space amplification from compaction must be managed
  • −Only C++, C and Java APIs are first-party
  • −Not a database server: no networking, replication or query language

Great for

  • +Storage engine for a custom database or service
  • +Stream-processing state stores (Kafka Streams, Flink)
  • +MySQL storage engine via MyRocks
  • +Write-heavy local indexes and caches on SSD

Think twice for

  • −Teams wanting a ready-made database server
  • −Read-mostly workloads where a B-tree like LMDB is simpler
  • −Environments without C++ build tooling

Capabilities

Native or official first-party support · 4 of 25 tracked

✓Transactions
✓TTL / expiry
✓Durable persistence
✓Compression
–Joins
–Secondary indexes
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–Pub/Sub
–Columnar storage
–In-memory
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Medium · ≤ 10 TB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Schemaless
Architecture
Embedded
Query languages
C++ API

Single-process library; multi-terabyte instances per node are common, and distribution is left to the system embedding it.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsC++ API, C API, RocksJava
client languagesC++, C, Java
used byMeta, LinkedIn

Alternatives to RocksDB

Compare all→
LevelDBKey-Value33.4

Google's original small, fast LSM key-value library, now in limited-maintenance mode.

rocksdb vs leveldb →
PebbleKey-Value5.6

Cockroach Labs' Go LSM engine, inspired by RocksDB and tuned for CockroachDB.

rocksdb vs pebble →
LMDBKey-Value39.7

Tiny memory-mapped B+tree with ACID transactions and lock-free readers; reached 1.0 in 2026.

rocksdb vs lmdb →
WiredTigerKey-Value20.6

MongoDB's default storage engine: MVCC B-tree with compression and snapshot isolation.

rocksdb vs wiredtiger →
BadgerKey-Value10.7

Pure-Go LSM key-value store that separates keys from values to cut write amplification.

rocksdb vs badger →
SpeedbKey-Value2.3

RocksDB-compatible storage engine fork; open-source development stopped after Redis bought it in 2024.

rocksdb vs speedb →

RocksDB FAQ

What is RocksDB?

RocksDB is a key-value database by Meta, first released in 2013. RocksDB is a C++ library for persistent, ordered key-value storage built on a log-structured merge tree and tuned for fast SSDs. Meta forked it from LevelDB in 2012 to add multi-threaded compaction, column families, transactions, rich tuning options and much better write throughput, and it has since become the default building block for storage engines: MyRocks, TiKV, Kafka Streams and Flink state, CockroachDB before Pebble, and many more. It is not a server; you embed it and own the API on top. Expect a large configuration surface, and budget time to understand compaction styles and write amplification.

Is RocksDB open source?

Yes. RocksDB is open source. License: Apache License 2.0 or GPL-2.0 (dual).

Does RocksDB support ACID transactions?

Yes. RocksDB supports full ACID transactions, with strong consistency.

Does RocksDB scale horizontally?

RocksDB does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at medium scale (≤ 10 TB).

How can I run RocksDB?

You can self-host it and embed it in your application.

What is RocksDB best for?

RocksDB is a strong fit for storage engine for a custom database or service; stream-processing state stores (Kafka Streams, Flink); and MySQL storage engine via MyRocks. Think twice for teams wanting a ready-made database server.

What are the best alternatives to RocksDB?

Common alternatives to RocksDB include LevelDB, Pebble, LMDB, WiredTiger and Badger. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is RocksDB?

RocksDB ranks #30 of 844 databases on the WhichDB Score (48.2/100), and #5 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.