SD System Design In Depth
0%
lesson system-designstorage-engines

Storage engine tradeoffs

Module 2.3: Storage Engine Internals & Blob Systems Updated Sep 17, 2026
📄 Cheat Sheet
How Databases Actually Store Your Data (B-Trees vs LSM Trees Explained)
ByteMonk How Databases Actually Store Your Data (B-Trees vs LSM Trees Explained) Watch on YouTube ↗

A focused, well-animated side-by-side of B-trees and LSM-trees that walks the read, write and space costs, which is exactly the tradeoff frame of this unit.

0:00 / --:--

Under the Hood: The RUM Conjecture

Formulated by researchers Manos Athanassoulis and Stratos Idreos at Harvard, the RUM Conjecture describes a lower-bound tradeoff among read overhead, update overhead, and memory overhead: reducing one usually consumes more of at least one other resource. It is a design lens, not a rule that every engine cleanly optimizes exactly two:

  • R (Read Amplification): The ratio of bytes read from physical storage to the bytes returned to the application. High read amplification means multiple disk blocks must be read to satisfy a single point or range query.
  • U (Update / Write Amplification): The ratio of bytes written to physical storage to the bytes updated by the application. High write amplification exhausts disk bandwidth and accelerates SSD wear.
  • M (Memory Overhead): The auxiliary in-memory state required by the access method, such as indexes, filters, and routing metadata. Disk-space amplification is a related operational metric, but it is not the M in the RUM formulation.

The RUM Tradeoff Frontier

flowchart TD Tradeoff{"Storage Engine Architecture"} Tradeoff -->|"B+ Tree (InnoDB / Postgres)"| BTree["Optimize Read & Space Amplification (1-2 disk reads, 1.2x space) at the cost of high Write Amplification (10x-50x 16KB page rewrites)"] Tradeoff -->|"LSM Tree (RocksDB / Cassandra)"| LSM["Optimize Write Amplification (sequential appends) at the cost of high Read Amplification (multi-SSTable scans) and Space Amplification (compaction debt)"] Tradeoff -->|"Fractal Tree / B-epsilon Tree"| Fractal["Balanced compromise: Buffer messages in internal tree nodes to trade write I/O for tree depth"]

Detailed Comparison: B+ Trees vs LSM Trees

DimensionB+ Tree Storage EngineLSM-Tree Storage Engine
Write PatternIn-place update of 8KB/16KB pages on diskSequential append to WAL + memory buffer
Point Read LatencyFast: O(log_B N), typically 2-3 page reads from cacheSlower: Requires checking memtable, bloom filters, and multiple SSTables
Write ThroughputModerate: Limited by random I/O and locking page latchesHigh: bursts are limited by sequential bandwidth, but sustained throughput is bounded by compaction bandwidth (engines stall writes when compaction falls behind)
Write Amplification FactorOften high and workload-dependent: a 50-byte update can dirty a full 16KB page, though buffer pools absorb many updates per page flushModerate: roughly 10x-30x for leveled compaction, lower (often under 10x) for tiered compaction
Space UtilizationModerate: after random inserts pages average about 69% full (about 30% free space) because of page splitsHigh: Sorted keys allow dense prefix compression (ZSTD / Snappy)
Check yourself Question 1 of 3
The M in RUM recall
From: Under the Hood: The RUM Conjecture

In the RUM Conjecture as this lesson defines it, what does the M (memory overhead) measure?

Storage Write Amplifier

LSM-Tree

Memtable Append -> SSTable Flush

Total I/O: 0 ops

B-Tree

In-place Page Update -> Dirty Flush

Total I/O: 0 ops

Key Takeaways

The RUM tradeoff connects read overhead, update overhead, and auxiliary memory; disk-space amplification should be measured separately.
B+ Trees optimize for point reads and predictable space at the expense of random write amplification.
LSM-Trees optimize for sequential write throughput and compression at the expense of point read complexity and background compaction.
Was this lesson helpful? Spot an issue or have a suggestion? Let us know on GitHub.
Report an issue