jonnify·redis /redis-patterns/overview

R0 · Overview

Applied, to the
BCS architecture.

Orientation before the patterns: EchoMQ backed by Valkey, Valkey under the hood, EchoCache 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 EchoCache 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.

§1

Two surfaces over one Valkey

bcs3.1 · bcs4.1 · bcsA

One 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 EchoCache near-cache. EchoCache 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.

The seam · two surfaces over one Valkey — the split the catalog grounds in
the EchoMQ bus the EchoCache near-cache emq:{q}: · four sorted sets · one job hash every transition a single Lua script L1 · declared ETS tables · 762 ns hit fills and invalidations through the L2 grounds R2–R6 · R8 grounds R1 · R7 read-models Valkey · :6390 one engine · the shared L2 · the conformance gate

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.

§2

Pick a surface

committed figures, quoted verbatim

The split is the catalog’s map. Pick a surface to read which chapters it carries and the committed figures that ground it.

The two surfaces · the readout quotes each surface’s committed record
readout · Select a surface. Each one answers with its committed record — the keyspace, the figures, and the chapters it grounds.

The read path grounds in EchoCache; the bus families ground in the emq:{q}: keyspace and its scripts. Each chapter names its surface up front.

§3

The fence, and the door

content/bcs3.1.md

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

/echomq · the far side of this door

The version fence, read live

content/bcs3.1.md · the fence, through the fenced connector itselffrozen
GET {emq}:version              answers echomq:2.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.

§4

The R0 modules

orientation before R1

Two orientation modules set up the grounding the pattern chapters reuse.

built lesson ready
§5

Up next — the pattern chapters

R1–R8 · the EchoMQ build order

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

R1built

Caching

The read path — fast reads, consistent on writes. → EchoCache

R2built

Coordination

Atomicity first — locks and atomic Lua moves.

R3built

Reliable Queues

Wait, active, done, recover — the heart of EchoMQ.

R4built

Time, Delay & Priority

The sorted set as a clock and a priority ladder.

R5soon

Streams & Events

The durable log and event-driven coordination.

R6soon

Flow Control

Staying stable under load — limits and fairness.

R7soon

Data Modeling

How data lives in RAM, and the read-models.

R8soon

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.

§6

References

sources · related

Sources

Related in this course