Why it matters
LSM-trees dominate modern write-heavy databases. Understanding shapes storage design.
Advertisement
The architecture
Memtable: in-memory sorted structure. Writes go here first.
SSTable: sorted immutable file on disk. Flushed from memtable.
Advertisement
How it works end to end
Read path: check memtable + all SSTables (with bloom filter to skip).
Compaction: merge SSTables to reduce count + reclaim tombstoned space.
Level-based (LevelDB) vs size-tiered (Cassandra) compaction strategies.
Trade-off: write amplification (multiple rewrites) vs read amplification (multiple files per query).