TL;DR: The thing that caught me off guard the first time I profiled a write-heavy Postgres instance wasn't CPU saturation or memory pressure — it was await time on disk I/O. The B-tree index was healthy, the query plans looked fine, but we were hammering somewhere around 40-50k inser
📖 Reading time: ~38 min
What's in this article
The Problem That Made LSM Trees Necessary
How an LSM Tree Actually Works (No Hand-Waving)
Write Amplification vs Read Amplification vs Space Amplification
Leveled Compaction vs Tiered Compaction — When Each Actually Makes Sense
LSM Trees in the Wild: RocksDB, LevelDB, Cassandra, and ClickHouse
Hands-On: Poking at RocksDB Internals
Bloom Filters: The Thing That Saves LSM Reads
Compaction Tuning: The Stuff the Docs Gloss Over
The Problem That Made LSM Trees Necessary
B-Trees Are Excellent — Right Up Until Your Write Rate Destroys You
The thing that caught me off guard the first time I profiled a write-heavy Postgres instance wasn't CPU saturation or memory pressure — it…