Every high-throughput database, cache tier, and stream processor is built upon a small set of specialized data structures designed around the physical asymmetry between CPU cache lines, DRAM, and NVMe flash pages. Choosing between a Tree and an LSM-Tree, or between an R-Tree and a discrete H3 hexagonal grid, directly dictates a storage engine’s read amplification, write amplification, and space amplification.

This chapter progresses systematically from disk-backed indexing to probabilistic memory structures. You first dissect 16 KB slotted-page Trees and two-dimensional spatial indexes (CORE-M08-004), then contrast their in-place random write amplification against append-only LSM-Trees and SSTable compaction (CORE-M08-003). Next, you eliminate SSTable point-lookup I/O waste using Bloom and Cuckoo Filters (CORE-M08-001), distribute keys across cluster nodes via Consistent Hashing with Virtual Nodes (CORE-M08-002), and bound high-cardinality streaming telemetry in kilobytes of RAM using HyperLogLog and Count-Min Sketch (CORE-M08-005).

What you will learn

  • Deconstruct 16 KB slotted-page B+ trees, latch crabbing concurrency, and hierarchical spatial indexes (Geohash, Uber H3, Google S2, R-trees)
  • Contrast in-place B+ tree page updates against append-only Log-Structured Merge (LSM) trees, MemTables, SSTables, and Leveled vs. Size-Tiered compaction
  • Derive optimal bit-array sizing and hash function counts () for Bloom filters eliminating unnecessary SSTable disk reads
  • Implement Consistent Hashing rings with Virtual Nodes and Bounded Loads to bound partition skew and node rebalancing movement to
  • Bound sub-linear memory error rates for HyperLogLog cardinality estimation () and Count-Min Sketch heavy-hitter frequency tracking
STAGE TOPICS

Topics in this chapter