B4 · EchoStore
The declared near-cache.
EchoStore is Part IV: L1 ETS tables in front of the L2 Valkey systems already share. The cache is declared, not discovered; a read never enters the owner; a miss is one fill per herd; coherence is a two-identity message.
Three dives. The declared cache and its two tiers; the cache-aside read path and its single fill; coherence by mint-time version — the durable Graft floor beneath is B5.
The three dives
each a leaf, the teachingThe declared near-cache
L1 ETS in front of L2 Valkey; the cache is declared, not discovered — every table in a directory that monitors its owner, addressed by ecc:{table}:id.
One fill per herd
A hit is a caller-side :ets.lookup; a miss coalesces a herd onto one in-flight load; expiry is jittered; a full cache degrades to pass-through.
Coherence
A two-identity invalidation — name and mint-time version — newer-wins by eleven snowflake bytes, over a broadcast lane through EchoStore.Ring or an at-least-once job lane.
A chapter is three dives. Each dive is one idea with one figure you can take apart.
The cache, in one law
echo_store · echo_store.exEchoStore is Part IV: the declared near-cache. L1 ETS tables sit in front of the L2 Valkey systems already share, and the cache is declared, not discovered — every table registers its kind, its TTL, and its coherence mode in a directory, and a cache absent from the directory does not exist. A read is a caller-side lookup that never enters the owning process; a miss is one fill per herd, coalesced onto a single flight; expiry is jittered so no cohort dies together; and coherence travels as a two-identity message — the name and the writer’s mint-time version — over a broadcast lane and a job lane. The durable floor beneath it, the Graft engine, is B5.
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 public read-concurrent L1 table a hit reads directly
- Valkey — Cluster specificationthe hash tag that lands one cache's ecc: keys on one slot
- Thompson et al. — The LMAX Disruptor (2011)the single-writer pre-allocated ring the broadcast applier mirrors
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus