Menu

Post image 1
Post image 2
1 / 2
0

LSM Trees: Why Your Database Writes Are Fast and Your Reads Are Lying to You

DEV Community·우병수·26 days ago
#YRtxWL6d
Reading 0:00
15s threshold

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 was await…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More