jonnify·bcs /bcs/together/the-read-path

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.

A caller-side hit, then a fill down the four-tier ladder. Select a part.
a read: id caller-side :ets.lookup — no process ETS · L1 cacheValkey · L2 (ecc:)CubDB · the page floorTigris · the remotea hiteach tier answersbefore the one beneath one branded id keys every tiercoherence keeps the cache current — newer-wins
readout · Select a part. A hit is a caller-side ETS lookup; a miss fills down through Valkey, the store, and the floor; one branded id keys every tier, kept current by coherence.
§1

The idea

echo_store · table.ex, graft/reader.ex

A 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.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related