Capstone: Mini Storage Engine

Lesson, slides, and applied problem sets.

View Slides

Lesson

1 min read

Capstone: Mini Storage Engine

Why this module exists

Real systems are about composition. This capstone stitches together the core components you built: pages, WAL, recovery, and indexing. The result is a tiny but correct storage engine.


1) Components

Your capstone includes:

  • Slotted pages for records
  • WAL for durability
  • Recovery (redo + undo)
  • B+Tree index for key lookups

2) Failure model

We assume a crash can happen at any moment:

  • pages may be dirty in memory
  • WAL is durable up to its end

Recovery must produce a consistent state as if only committed transactions occurred.


3) Correctness over speed

This is a toy engine. The goal is correctness and invariants, not throughput. The code should be small but explicit: every update must be logged and ordered.


What you will build

  • A mini key/value engine with WAL-backed recovery and indexed lookups.

Key takeaways

  • End-to-end correctness is a composition of small invariants.
  • WAL and recovery are the backbone of durability.
  • Index correctness depends on stable record IDs.

Module Items

Join Discord