B6.3 · dive 3 of 3
One read, all the way up.
A read is a caller-side L1 hit, or a miss filling down through Valkey, the store, and the floor — ETS to Tigris, one branded id keying every tier, kept current by coherence.
The idea
echo_store · table.ex, graft/reader.exA read climbs the same stack in reverse, and most reads stop at the first rung. A hit is a caller-side :ets.lookup against the L1 table — it never enters a process and never leaves the node. The cheapest read is the common read, and the tiers beneath exist for the times the answer is not yet in the heap.
A miss fills from below, one rung at a time. L2 is the shared Valkey at ecc:{table}:id; beneath it the declared loader reads the system’s store; beneath that the floor reads pages from CubDB and, if they are not local, from Tigris — fetching only the pages the read touches. Each tier answers before the one beneath is asked, so a read pays for exactly the depth it needs and no more: ETS, then Valkey, then CubDB, then Tigris.
What ties the rungs together is the name. The same branded id keys the cache row, the store entry, the page on the floor, and the object in the bucket — a read is one question asked at four depths, not four lookups translated between four schemes. And coherence keeps the climb current: when a write lands, its mint-time version invalidates the cached row, so the next reader either finds the new value or misses cleanly and fills it. The stack is fast at the top, durable at the bottom, and consistent by the id that runs through all of it.
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
- Erlang/OTP — the ets modulethe L1 table a read hits caller-side before any tier beneath
- Tigris — conditional object operationsthe durable floor at the bottom of the read ladder
- King — Announcing Snowflake (2010)the node singleton seeded and proven at boot, keying every tier
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus