ChaptersStorage

Storage

How does a database physically store data so writes are durable and reads are fast?

3 lessons · 20 concepts · ≈ 1 h 20 min

Not started

  1. Lesson 1 · ≈ 25 min

    Storage Engines

    Every database is a bet about where to pay for writes. B-trees pay up front by updating pages in place; LSM-trees pay later by merging immutable files in the background. Here's how each works, and how each fails.

  2. Lesson 2 · ≈ 25 min

    Indexes & Search

    An index is a second copy of your data, sorted for one kind of question. From B-tree lookups to keyword search to "find me something like this", what each index answers, what it costs every write, and how it fails.

  3. Lesson 3 · ≈ 30 min

    Analytics & Columnar Storage

    A transaction touches one row and every column. An analytic query touches every row and a few columns. Turning the table on its side, then compressing, sorting and skipping, is how warehouses scan billions of rows in seconds.