Skip to content

SYSTEM Cited by 2 sources

RocksDB

RocksDB is an embeddable, high-performance, persistent key-value store originally built at Facebook/Meta, derived from Google's LevelDB. It's LSM-tree-based, written in C++, and widely used as an embedded storage engine in larger systems.

This wiki currently treats RocksDB as a stub — a named storage substrate referenced by other pages, not a deep-dive of its internals. Deepening is expected as more RocksDB-centric sources are ingested.

Project

  • Site: rocksdb.org
  • GitHub: facebook/rocksdb
  • License: Apache 2.0 / GPLv2 dual-licensed
  • Origin: fork of LevelDB (Google), 2012, by Facebook's database engineering team.

Role in Glean

Meta's Glean uses RocksDB as its fact-storage engine: "The data is ultimately stored using RocksDB, providing good scalability and efficient retrieval" (Source: sources/2025-01-01-meta-indexing-code-at-scale-with-glean). Glean stores arbitrary-schema facts keyed to predicate-field prefixes so that Angle queries specifying a prefix of fields can be served by prefix scans in RocksDB. RocksDB-level immutability also aligns with Glean's stacked immutable databases design for incremental indexing: Glean doesn't rewrite prior-revision fact data, it composes layers on top.

Architectural shape (brief)

  • LSM-tree storage. Writes go to an in-memory memtable + WAL; once the memtable fills it's flushed as an SSTable (Sorted String Table) on disk. Background compaction merges SSTables.
  • Column families. Independent keyspaces within one RocksDB instance, each with its own options (comparator, compression, compaction).
  • Merge operators + custom comparators. Embedder-defined semantics for value combining and key ordering.
  • Reads scan the memtable + SSTables in level order; bloom filters + block caches reduce I/O.

None of this is load-bearing to the Glean post, which treats RocksDB as a black-box persistent KV — but the design symmetry (immutable SSTables + layered composition) is why Glean's stacked-database mechanism is a natural fit underneath.

Seen in

Last updated · 319 distilled / 1,201 read