The System Design & AI Dispatch:
Back to All Newsletters
Edition #110 min read
#Databases#Storage#Raft#Consensus#LSM Trees

LSM-Trees vs B-Trees: Why Write-Heavy Workloads Choose Log-Structured Storage

Analyzing write amplification, SSTables, MemTables, and compaction strategies.

Marcus Vance
Marcus Vance
Principal Storage Architect
Published on Aug 02, 2026

1. Random vs Sequential Disk Writes in NVMe SSDs

Hard drives and NVMe SSDs write sequential data 10x-100x faster than random in-place page updates. B-Trees perform in-place updates leading to write amplification. LSM-trees append all writes sequentially to an in-memory MemTable and commit log.

2. B-Tree In-Place Page Splits & Write Amplification

When a B-Tree node page fills up, inserting a new key causes a 50/50 page split, requiring multiple synchronous random disk writes and WAL updates.

3. LSM-Tree Architecture: MemTable & Commit Log

LSM-Trees buffer incoming writes in an in-memory SkipList or Red-Black Tree (MemTable) while appending to a sequential write-ahead log for durability.

4. Immutable Sorted String Tables (SSTables) on Disk

When the MemTable fills, it flushes to disk as an immutable Sorted String Table (SSTable). Keys in SSTables are pre-sorted, allowing fast binary search.

5. Leveled Compaction vs Size-Tiered Compaction

Background compaction merges sorted runs to eliminate duplicate keys and reclaim disk space.

6. Bloom Filters: Eliminating Point-Lookup Disk Seeks

Probabilistic Bloom filters loaded in RAM determine whether an SSTable file contains a key with zero disk I/O for 99% of negative queries.

7. Read Amplification & Write Amplification Formulas

Calculating the exact ratio of bytes written/read to storage media versus logical bytes requested by the application.

Reached Preview Limit (7 of 30 Concepts Read)

Subscribe to continue reading the full masterclass

You’ve finished the first 7 concepts. Join 120,000+ senior engineers to unlock the remaining 23 concepts, deep-dive trade-off diagrams, and our 120+ edition archive.

Visual breakdown of MemTable flush and SSTable compaction
Bloom filter optimization to eliminate unnecessary disk seeks
Full access to all database internals and consensus modules
Already subscribed? Sign in to your account