Module 6 · Dive 6.1
One log, three replays.
Put three cursors on the same commit log: a booting process at the last snapshot, a replica at its own LSN, a feed subscriber at its cursor. Advancing any of them runs the identical step — apply(commit) — one LSN at a time toward the head. Different starts, one operation. Advance them and watch.
Same step, different starts
interactiveWhy one mechanism is enough
graft.design.mdCollapsing three features into one fold is not a tidy diagram — it is the reason the engine is small. There is a single, well-tested replay path; boot, catch-up, and the feed are call sites that hand it a starting LSN. Determinism does the rest: the same commits applied in the same order reach the same state, so a replica that replays the primary’s log is the primary, and a feed subscriber sees exactly what a recovering process would. The next two dives are just this fold with the starting LSN and byte source pinned down — green boot from the local snapshot, replica catch-up from remote segments.
References & sources
- Echo records
- graft.design.mdthe unified replay path
- store.design.mdapply(commit) from a starting LSN
- External
- State machine replicationdeterministic replay = agreement
- Foldapply, repeated, over a sequence
- Designing Data-Intensive Applications, Kleppmann 2017logs and replication (Ch. 5)