B4.1 · dive 1 of 3
The declared near-cache.
Part IV adds a cache, declared not discovered: L1 ETS tables in front of the L2 Valkey systems already share, every table registered in a directory that monitors its owner.
The idea
echo_store · echo_store.ex, table.ex, keyspace.exPart IV adds a cache, and its first law is that the cache is declared, not discovered. EchoStore is the near-cache layer: L1 ETS tables in front of the L2 Valkey that systems already share. Every table registers its full specification in a directory at start; an operator enumerates every cache on the node with tables/0; and a cache absent from the directory does not exist. There is no ambient, accidental cache — only declared ones, each with a kind, a TTL, and a coherence mode written down.
The two tiers divide by reach. L1 is an in-process ETS table, public and read-concurrent, local to one node; L2 is the shared Valkey the bus already runs on, addressed through the cache’s own keyspace, ecc:{table}:id — a fresh prefix beside emq:, the table name hashtagged so every key of one cache lands on one slot when clustering arrives. The id in the key’s value position is checked for shape before any key is composed, so a malformed name never reaches the wire.
The directory is alive. It monitors each table it registers, so a crashed cache leaves the roster the moment it leaves the node, and the enumeration is never stale. A cache, in BCS, is a declared component with a boundary and an owner, registered and watched — not a map someone reached for. It is the discipline the law applies to systems, applied to the things that make them fast.
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
- Helland — Life Beyond Distributed Transactions (CIDR 2007)the entity addressed by a key, cached close to its use
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus