jonnify·persistence /echo-persistence/local-store/mvcc-time-travel

Module 5 · Chapter II — The local store

MVCC & time travel.

Module 4 left us with one fact: old roots stay valid. Multiversion concurrency control is what you get for free from it. A snapshot is a retained root, so readers never lock and never block the writer, and “the state at any past LSN” is just the root that was current then. Three facets of one idea — tap each.

One idea, three facets. Versioned roots over a shared, immutable node pool, with a reader pinned to a past version. Tap a facet to light up what it means.
shared immutable node pool (Module 4) reader @ v2 writer (head)
readout · Tap a facet. Every version is a root over one shared node pool; a snapshot is just one of those roots, which is why reading is free, lock-free, and works on any past version.
§1

One fact, three payoffs

graft.design.md

Because an update keeps the old root (Module 4), many versions exist at once over a single, shared, immutable node pool — that is coexisting versions. A reader grabs the current root and reads it to completion no matter what the writer does next, and the writer appends new roots without waiting on any reader — that is lock-free concurrency, readers and a writer with no mutual blocking. And since each LSN named a root, you can open the root that was current at any LSN — that is time travel, the checkout-at-LSN the change feed and replicas depend on. Each is a dive.

§2

The three dives

module 5
§3

Build & check

What you build

One sentence each linking the three facets back to Module 4’s “old roots stay valid”: why coexistence is automatic, why reads need no lock, and why checkout-at-LSN is well-defined. No numbers — the chain of reasoning is the deliverable.

Check

Answer without code: what exactly is a snapshot, in one phrase; and what is the single thing GC must never reclaim? If you said “a retained root” and “a root a reader still pins,” you have the module.

§4

References & sources