B5 · The Persistence Floor
Where state lives when the heap is gone.
B5 is EchoStore.Graft: a native-BEAM build of Graft’s idea — lazy, partial, strongly consistent page replication on object storage, with no foreign engine. A single-writer volume on CubDB, a lazy reader fronted by the ETS head page, a remote on Tigris.
Three dives. The single-writer engine and its append-only B-tree; the lazy, partial reader at a snapshot; the portable remote, the commit-LSN cursor, and the stream archive.
The three dives
each a leaf, the teachingThe single-writer engine
One VolumeServer per volume, its mailbox the write lock; pages staged at low indices and committed onto CubDB’s append-only immutable B-tree.
The lazy reader
Lazy, partial replication: a reader pulls only the pages a read touches, the newest from the L1 ETS head, at a serializable snapshot.
B5.3The portable remote
Streamer to Tigris in real time, Sync notices over the bus, the commit-LSN as cursor, and the stream archive folding trimmed streams in.
A chapter is three dives. Each dive is one idea with one figure you can take apart.
The floor, in one law
echo_store · graft.exB5 is the persistence floor: EchoStore.Graft, a native-BEAM build of Graft’s idea — lazy, partial, strongly consistent, page-based replication on object storage, with no foreign engine. A volume is a single-writer process whose mailbox is the global write lock; its store is CubDB’s append-only immutable B-tree, where a snapshot costs nothing; its L1 is the same EchoStore.Table that fronts the cache, used here as the write-through head page. A reader fetches only the pages a read touches; Graft.Streamer ships segments to Tigris in real time, the native replacement for Litestream; commit notices ride the bus while the bytes travel via Tigris; and the commit-LSN is the cursor a replica reads from. The stream archive folds trimmed EchoMQ.Stream segments into the same floor — deep history without resident memory.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- orbitinghail — Graft: lazy, partial, strongly consistent replicationthe page-replication engine echo_store builds natively on the BEAM
- Ong — CubDB, an Elixir embedded key-value storethe append-only immutable B-tree the volume commits onto
- Tigris — conditional object operationsthe conditional commit objects that make object storage a transactional remote
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus