Module 2 · Dive 2.3
Recovery & replay.
A crash takes the heap, not the disk. Recovery is two moves: load the last snapshot, then replay the intents recorded after it. The snapshot is a fast starting point; the intent log carries the rest. Step it through and watch the in-heap state rebuild to exactly where it was.
Restore, then replay
interactiveThe log is the truth
graft.design.mdThe snapshot is an optimization, not the source of truth — it just spares you replaying from the beginning. Truth is the snapshot plus the ordered intents after it, so recovery is deterministic: same snapshot, same intents, same state. Measured on the bench, a seed-and-restore lands in single-digit milliseconds and replay runs at over a million intents a second — indicative single-core figures, included only to say the operation is cheap, not slow. The same restore-plus-replay shape returns later for replicas catching up and for the change feed; here it is at its simplest.
References & sources
- Echo records
- store.design.mdseed + restore, intent replay
- graft.design.mdthe snapshot-plus-log recovery model
- External
- Write-ahead logginglog-then-apply, the replay idea
- Designing Data-Intensive Applications, Kleppmann 2017snapshots + logs, deterministic replay (Ch. 3)