Real-World Case Studies: Storage Engines and Indexing

✅ Source-checked. Each deep dive names its source, and we kept only what that source says. Found an error, or something the source doesn't support? Report it on the tracking issue.

One design, three generations: Bigtable's memtable-and-SSTable engine (based on the 1996 LSM-tree), LevelDB, which is "similar in spirit" to a Bigtable tablet, and RocksDB, which started as a fork of LevelDB.


đŸĸ Deep Dive 1: Bigtable's Write Path

Source: Bigtable: A Distributed Storage System for Structured Data (Chang et al., OSDI 2006). Everything in this section comes from the paper.


đŸ—‚ī¸ Deep Dive 2: LevelDB, Levels of Sorted Files

Sources: LevelDB implementation notes and README (authors Sanjay Ghemawat and Jeff Dean). Everything in this section comes from those.


đŸ”Ŧ Deep Dive 3: RocksDB, LevelDB Tuned for Flash

Source: the RocksDB Overview wiki page. Everything in this section comes from it.

â„šī¸ An earlier version of this page said Google's LevelDB "pioneered" the LSM-tree, which predates it by more than a decade, and quoted MyRocks storage savings, ZippyDB throughput and Netflix's use of RocksDB in Flink and Mantis. None of the sources above cover those, so we removed them.


đŸŽ¯ System Design Interview Takeaways

  1. LSM-trees turn random writes into sequential ones. Buffer writes in memory, flush sorted files, and merge them in the background.
  2. Compaction is the cost. Every byte may be rewritten several times as files merge (write amplification). RocksDB's compaction styles let you trade that against space and read cost.
  3. Bloom filters keep reads cheap. They let a read skip files that definitely don't contain the key.