SystemKit

Storage Engines

What actually happens to your data on disk. Start from a simple log, build up to LSM trees and B-trees, compare them by read, write, and space amplification, and see why analytics needs a different layout.

Lessons

  1. 01Start with an append-only logA file you only append to, plus an in-memory index, is a working database and the basis of crash recovery.
  2. 02Buffer in memory, merge on diskAn LSM tree keeps data sorted without editing files in place, then pays for that with background merging.
  3. 03Update pages in place with a B-treeA B-tree gives every key one home on a fixed-size page and relies on a log to survive a crash mid-update.
  4. 04Compare engines by what they amplifyThree ratios describe what an engine costs, and row size and access pattern can flip the winner.
  5. 05Pay for every index on every writeAn index is a second data structure that speeds some reads and must be kept up to date on writes.
  6. 06Store analytics by columnAnalytical queries read few columns across many rows, which calls for a different layout and often a separate system.