B6.2 · dive 2 of 3
One write, all the way down.
A write begins at a system’s store and fans out through a transactional outbox — record, enqueue on a lane, mark — rides an atomic Flow, and ends durable and announced.
The idea
echo_store · journal.ex · echo_mq · flows.ex, lanes.exA write begins inside one system, at its store: a put of a value under a branded id and a mint-time version. If that were the whole story, persistence would be a single call. But a real write fans out — it must settle work on the bus and survive a crash between the two — and that is what the rest of the path is for.
The seam is a transactional outbox. EchoStore.Journal records the writer’s intent, enqueues the job on a lane, and marks it enqueued; every crash window between those three steps is covered by replay, and the bus deduplicates a job that replay re-enqueues. The bus itself stays on Valkey, fast and volatile, while only the low-volume intent lands in the journal — so durability is a small, mostly idle dependency, not a tax on every step.
Multi-step work travels as a flow, and a flow is atomic. EchoMQ.Flows lands a parent and its children on one slot in one operation, so either the whole flow is enqueued or none of it is; the parent is held back until its last child completes. Settlement rides a lane, never an ungrouped enqueue, so a draining consumer always finds it. When the work is done the floor has the bytes and coherence has invalidated the cache by the same version — one write, made durable and announced, all the way down.
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
- Helland — Life Beyond Distributed Transactions (CIDR 2007)the outbox of activities that makes a multi-step write recoverable
- Kreps — The Log (LinkedIn Engineering)the bus as the log a write fans out onto
- Valkey — Scripting with EVALthe one atomic operation that lands a whole flow or none of it
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus