Skip to main content

Welcome to RocksDB

RocksDB is a high-performance embedded database library that provides a persistent key-value store for fast storage. Developed and maintained by the Facebook Database Engineering Team, RocksDB is built on LevelDB and optimized for modern storage hardware, especially flash drives.

Quick Start

Get up and running with RocksDB in minutes

Installation

Install RocksDB on your platform

API Reference

Explore the complete API documentation

Developer Guide

Learn from real-world code examples

Why RocksDB?

RocksDB is designed to efficiently use modern hardware while providing exceptional performance for a wide range of workloads.

Key Features

RocksDB uses an LSM database design with flexible tradeoffs between:
  • Write-Amplification-Factor (WAF) - How much extra data is written compared to the original data
  • Read-Amplification-Factor (RAF) - How many disk reads are needed for a single query
  • Space-Amplification-Factor (SAF) - How much extra space is used beyond the actual data
This architecture makes RocksDB especially suitable for write-heavy workloads.
RocksDB supports multi-threaded compactions, allowing it to efficiently manage databases storing multiple terabytes of data. This parallel processing capability ensures consistent performance even with large datasets.
Built specifically for modern flash drives, RocksDB leverages the characteristics of flash storage to deliver:
  • High throughput for both reads and writes
  • Low latency for point lookups
  • Efficient space utilization
RocksDB powers critical infrastructure at scale:
  • Used by Facebook, LinkedIn, Yahoo, and many other companies
  • Handles billions of operations per day
  • Battle-tested in production environments

Core Capabilities

Key-Value Store

Store arbitrary byte arrays as keys and values with ordered iteration support

Column Families

Logically partition your data while sharing the same write-ahead log

Transactions

ACID transactions with optimistic and pessimistic concurrency control

Snapshots

Point-in-time consistent views of your database

Backups

Built-in backup and restore capabilities

Compression

Multiple compression algorithms: Snappy, Zlib, LZ4, ZSTD, Bzip2

API Overview

RocksDB provides a simple and intuitive API for database operations:
#include "rocksdb/db.h"
#include "rocksdb/options.h"

using namespace ROCKSDB_NAMESPACE;

// Open database
DB* db;
Options options;
options.create_if_missing = true;
Status s = DB::Open(options, "/tmp/testdb", &db);

// Write key-value
s = db->Put(WriteOptions(), "key1", "value1");

// Read value
std::string value;
s = db->Get(ReadOptions(), "key1", &value);

// Delete key
s = db->Delete(WriteOptions(), "key1");

delete db;
RocksDB is safe for concurrent access from multiple threads without any external synchronization.

Use Cases

RocksDB excels in scenarios requiring:
  • High-throughput writes - Web applications, logging systems, metrics collection
  • Large datasets - Multi-terabyte databases with billions of keys
  • Low-latency reads - Caching layers, session stores, real-time analytics
  • Embedded databases - Applications needing local persistent storage without a separate database server
  • Stream processing - Stateful processing in Apache Flink, Apache Kafka Streams, etc.

Performance Characteristics

RocksDB can achieve:
  • Millions of operations per second on modern hardware
  • Sub-millisecond p99 latencies for point lookups
  • Gigabytes per second of write throughput
  • Efficient storage with compression ratios of 2-5x depending on data

Community and Support

GitHub Repository

Star the project, report issues, and contribute

Community Forum

Join the RocksDB Developers Public Facebook group

Mailing List

Subscribe to the Google Groups mailing list

Wiki

Detailed documentation and design docs

Licensing

RocksDB is dual-licensed under both the GPLv2 and Apache 2.0 License. You may select, at your option, one of the above-listed licenses.

Next Steps

Ready to start using RocksDB?
1

Install RocksDB

Follow the installation guide for your platform
2

Quick Start

Build your first RocksDB application with the quick start guide
3

Explore Examples

Learn from code examples covering common use cases
4

Configure for Production

Optimize RocksDB for your workload using tuning guides

Build docs developers (and LLMs) love