Expand description
Multi-version storage backend for OLTP traffic. Implements the MultiVersionStore family of traits from
core::interface::store so the engine can read at a snapshot, write a new version, and step backwards through
history without coordinating with concurrent readers.
The backend is tiered: hot writes land in the in-memory buffer, the flusher migrates them to persistent storage at commit boundaries, and the garbage collector reclaims versions that have aged out behind the configured retention. The persistent tier is pluggable - a SQLite-backed implementation is the default but the trait surface is what the engine binds to, so other backends can be slotted in.
Invariant: a row at version V is the value visible to a reader whose snapshot is >= V and where no later
version exists at V' <= snapshot. Commit must publish all deltas of a transaction atomically with respect to
readers; partial visibility breaks snapshot isolation.
Modules§
- buffer
- Hot tier of the multi-version store. Holds recent writes in memory before the flusher migrates them to the persistent tier. Reads consult the buffer first and fall through to persistent storage on a miss, so freshly-written rows are visible immediately without waiting for the flush.
- config
- flush
- Background flusher that migrates writes from the buffer tier to the persistent tier. The actor decides when to flush (size, age, explicit request) and the listener exposes flush events to anything that wants to track progress, like the admin UI or test harnesses waiting for durability.
- gc
- Garbage collection. Three reclamation strategies cover the cases the multi-version store generates: historical reclaims versions older than the active read watermark; row reclaims tombstones once no reader can see the pre-tombstone version; operator handles per-flow retention overrides where some operators keep less history than the global default.
- memory
- multi
- persistent
- Cold tier of the multi-version store. Holds the durable, version-history-bearing record of every key the buffer has flushed. The default backend is SQLite; the trait surface is generic so other backends can be plugged in without touching the buffer or transaction layer.
- sqlite
- store
- tier