R0 · Overview
Applied, to the
BCS architecture.
Orientation before the patterns: EchoMQ backed by Valkey, Valkey under the hood, EchoStore in front — the running system every pattern chapter grounds in.
One Valkey carries two surfaces. The EchoMQ bus owns the braced emq:{q}:
keyspace and its Lua state machine; the EchoStore near-cache reads through an L1 of ETS tables over the
shared L2. Every figure on this page is quoted verbatim from a committed record.
Two surfaces over one Valkey
bcs3.1 · bcs4.1 · bcsAOne Valkey — 9.1.0, listening on :6390 in the committed record —
carries two surfaces, and the two surfaces ground the two halves of the catalog.
The EchoMQ bus. EchoMQ owns its protocol: the braced emq:{q}: keyspace,
jobs as entities, and a Lua state machine. The committed key map reads
emq:{orders}:pending | emq:{orders}:job:ORD0NgWEfAEJfs | {emq}:version | {emq}:locks —
17 bytes of grammar before a fourteen-byte branded payload. A job’s row is a hash of three fields;
four sorted sets per queue carry the lifecycle — pending score-zero, active
scored by lease deadline, schedule scored by run-at, dead score-zero — and
every transition is a single atomic script. The coordination, queue, time, streams, and flow families
(R2–R6) and the operations chapter (R8) ground here.
The EchoStore near-cache. EchoStore is “branded keys, local speed, bus-driven
coherence”: an L1 of declared ETS tables in front of the shared L2 Valkey. The committed figure:
1311621 hit reads per second (762 ns each) against 31 us per L2 GET
on the same wire — the L1 hit is 40 times cheaper than the round trip it replaces. The caching
family (R1) and the R7 read-models ground here.
One engine, two surfaces. The bus owns its keyspace and its state machine; the cache reads through the same engine at memory speed. Each pattern chapter names which surface it grounds in.
Notes on Valkey · hash tags force every key sharing a braced tag into one
CRC16-mod-16384 cluster slot — pending, active, meta, and the job row of {orders} all answer
slot 105; {fills} answers 4165 (bcs3.1) — which is what keeps every multi-key EchoMQ script
single-slot legal. Source: valkey.io/topics/cluster-spec.
Pick a surface
committed figures, quoted verbatimThe split is the catalog’s map. Pick a surface to read which chapters it carries and the committed figures that ground it.
The read path grounds in EchoStore; the bus families ground in the emq:{q}:
keyspace and its scripts. Each chapter names its surface up front.
The fence, and the door
content/bcs3.1.mdBefore a single pattern runs, the keyspace states which protocol it speaks. The version fence lives at
{emq}:version — the one key that is about the deployment rather than about any queue
— and the connector reads it on every connect, first boot and every reconnect, refusing to serve
against any other value. The committed read is self-referential: it travels through a connection that
could not exist had the fence not held.
The version fence, read live
GET {emq}:version answers echomq:3.0.0 ← through the fenced connector itself
rung record PASS 5/5
The wire string above is the only place the version number appears; the protocol is named EchoMQ. Its depth — the full keyspace grammar, the script inventory, conformance on Valkey — is the dedicated course on the far side of this door: EchoMQ — the protocol, in depth.
The R0 modules
orientation before R1Two orientation modules set up the grounding the pattern chapters reuse.
Valkey under codemojex
The placement — the two roles Valkey plays below the one owned wire facade
(EchoWire) codemojex calls: the EchoMQ bus and EchoStore. Dives: the facade seam
· the two roles · the reserved tier.
Patterns become protocol
The four-layer model and the immutable core — why the data model is the contract, and the door to the EchoMQ course. Dives: the four layers · the immutable core · the door to EchoMQ.
Up next — the pattern chapters
R1–R8 · the EchoMQ build orderThe eight pattern chapters, sequenced along the EchoMQ build. Each opens with its use cases and closes with a workshop that builds one slice of the BCS Redis tier.
Caching
The read path — fast reads, consistent on writes. → EchoStore
Coordination
Atomicity first — locks and atomic Lua moves.
Reliable Queues
Wait, active, done, recover — the heart of EchoMQ.
Time, Delay & Priority
The sorted set as a clock and a priority ladder.
Streams & Events
The durable log and event-driven coordination.
Flow Control
Staying stable under load — limits and fairness.
Data Modeling
How data lives in RAM, and the read-models.
Production & Operations
Running the tier at scale — the capstone.
A chapter card links through when its pages ship. The chapters are sequenced as the EchoMQ build, so the catalog doubles as a guided tour of the BCS Redis tier.
References
sources · relatedSources
- Redis — Documentationthe command and data-type reference behind the catalog
- Valkey — Topicsthe engine the EchoMQ connector is gated against
- Valkey — Cluster specificationhash slots, CRC16 mod 16384, and hash tags as the same-slot mechanism behind the co-location law
- Valkey — ProgrammabilityEVALSHA and atomic scripts, the discipline the bus rides
- llmstxt.org — the llms.txt conventionthe machine-readable map format the course follows
Related in this course
- Course homethe full chapter→module map
- R1 · Cachingthe read path; grounds in EchoStore
- R0.2 · Valkey under codemojexthe placement, in detail
- EchoMQ — the coursethe protocol in depth, the far side of the door
- The Branded Component Systemthe architecture these patterns run inside