Module 2 · Dive 2.2
The checkpoint dial.
Champ snapshots every K records. That single number is two things at once: the loss window — exactly the records accepted since the last snapshot — and the throughput dial, because one fsync covers all K. Feed the gauge, watch the at-risk window fill and a snapshot fire, then change K and see both move.
K is the loss window
interactiveThe same lever, named for Champ
graft.design.mdThis is the spectrum’s one knob, wearing Champ’s clothes. Records-per-fsync from Module 1 is here called K, and because the structure is persistent (Dive 2.1) the snapshot it fsyncs is a reference, not a copy — so raising K is nearly free on the accept side and simply widens the window. There is no “right” K; there is the K your queue’s tolerable loss allows. The next dive answers the question this raises: when the window does take records, how does Champ get them back?
References & sources
- Echo records
- graft.design.mdcheckpoint_every K, the loss window
- store.design.mdthe snapshot cadence
- External
- Valkey persistencethe time-based cousin (every-second)
- Designing Data-Intensive Applications, Kleppmann 2017snapshotting and bounded loss (Ch. 3)