B3.1 · dive 1 of 3
The keyspace.
The BCS law meets the wire. Every key on the bus is born braced for the slot, branded at the builder, and declared in KEYS[] — so the key is parsed and gated before Valkey sees it.
The idea
echo_mq · keyspace.exEchoMQ is the bus, and a bus is where the BCS law meets the wire: only branded identities and messages about them cross between systems. The discipline is in the key. Every EchoMQ key is born braced — emq:{queue}: — born branded — a JOB id gated at the key builder — and born declared — named in a Lua script’s KEYS[], never interpolated into the body. Building a key from an ARGV prefix inside a script body is exactly what this forbids — a key the script touches but never declares is invisible to the gate, so the keyspace draws every key from a total grammar instead.
The braces are a hash-slot tag. {queue} tells Valkey to place every key for one queue on the same slot, so a multi-key script touches one node and stays atomic on a cluster. The brace is not decoration; it is the difference between a script that runs and a CROSSSLOT error. The queue name is the slot, and the slot is chosen by the name.
The id inside the key is a branded JOB id, gated where the key is built, so a malformed or wrong-kind id is refused before it reaches Valkey. And every key a script reads or writes is passed in KEYS[], so the set of keys a script touches is declared and auditable, not assembled from string fragments at run time. Braced, branded, declared: the key is the contract, and the contract is checked before the wire.
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
- Valkey — Cluster specificationhash tags force a queue's keys onto one of the 16384 slots
- Valkey — Scripting with Luakeys must be passed as arguments, never programmatically generated
- King — Announcing Snowflake (2010)the roughly-sortable id the JOB key carries
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus