3.4. Storage Engines and Data Structures
Underneath every database is a storage engine deciding how bytes hit the disk, and that decision fixes the workload the database is good at. The central trade-off is LSM-tree versus B-tree: one optimizes writes by turning them sequential and paying at read time, the other optimizes reads and pays at write time. This chapter covers both, the data structures that make them practical (SSTables, memtables, Bloom filters), the write-ahead log that guarantees durability, and columnar layouts that flip the whole model for analytics.
Topics Covered
Section titled “Topics Covered”- 3.4.1. LSM-Tree vs. B-Tree: Write and Read Performance Trade-offs: Contrasts the write-optimized LSM-tree with the read-optimized B-tree and the amplification each pays.
- 3.4.2. SSTables, Memtable, and Compaction Strategies: Covers the LSM write path through the memtable to immutable SSTables and the compaction strategies that manage them.
- 3.4.3. Bloom Filters: Reducing Disk Reads: Explains the probabilistic filter that avoids disk reads for keys that are definitely absent.
- 3.4.4. Write-Ahead Log (WAL): The Foundation of Durability: Covers the write-ahead log that guarantees durability by recording changes before applying them.
- 3.4.5. Columnar Storage: Advantages in Analytical Queries: Explains why storing data by column instead of row transforms analytical query performance.