jonnify·redis /redis-patterns/overview/redis-under-portal

R0.2 · Overview — module hub

Valkey under the Exchange Platform.

Before the patterns, the placement. The Exchange Platform reaches one boundary — the echo data layer — and below it Valkey serves two roles: EchoCache, the near-cache, an L1 of ETS tables over the L2 Valkey, and the EchoMQ bus, the owned-protocol bus at echo/apps/echo_mq — both over one Valkey, and no surface holds a raw Valkey key.

Grounding: echo/apps/echo_wire · echo/apps/echo_mq · echo/apps/echo_cache · content/bcs3.1.md · bcs4.md · docs/exchange — every figure verbatim from a committed record. The Exchange Platform consumer is echo/apps/exchange.

The placement. Select a component to read its job and which side of the facade it lives on.
the order API a consumer a worker the echo data layer · one boundary — the boundary · no surface holds a raw Valkey key — EchoCache · the near-cache L1 ETS over L2 Valkey · derived state the EchoMQ bus emq:{q}:<type> · authoritative state Valkey · the engine
readout · Select a component. The surfaces stop at the boundary; EchoCache and the EchoMQ bus live below it, both over one Valkey.

Static verdicts — the surfaces → call only the echo data layer, hold no raw key · the boundary → the single owned client (EchoWire) · EchoCache → derived, safe to drop · the EchoMQ bus → authoritative, the four sorted sets · Valkey → external, an enforced conformance gate.

§1

Below the facade

bcs4 · emq.roadmap.md

The Exchange Platform reaches Valkey through one owned boundary — the echo data layer — and every surface, from the order API to a background consumer, calls that boundary and reads typed results, never a raw store condition. None of them opens a socket, holds a key, or branches on a wire error. The one owned Valkey client is EchoWire (echo/apps/echo_wire); above it sit two roles, both over Valkey: EchoCache, the near-cache in front of the read path — its one-line case is the Part IV title made plain, branded keys, local speed, bus-driven coherence — and the EchoMQ bus, the owned-protocol bus at echo/apps/echo_mq: the closed braced emq:{q}:<type> grammar, the three-field job hash, the four sorted sets, eight verbs over six scripts.

That single rule is the master invariant the whole course respects. It is why a cache can be added, swapped, or deleted without a surface changing — and why the bus could be re-derived and shipped as new code, the program story the third dive retells, without a surface changing either. The diagram above shows the boundary; the first dive proves it.

§2

Two roles, one store

content/bcs3.1.md · bcs3.2 · bcs4

Below the facade the store does two distinct jobs, and the two roles ground different halves of the catalog. The cache machine is EchoCache. It holds derived state — a copy of the truth, safe to drop; a dropped row costs a slower read, never a lost fact. The caching and data-modeling families ground here. The EchoMQ bus holds authoritative state — the jobs are the work. Per queue, four sorted sets carry the lifecycle: pending (score-zero, lex order is mint order), active (lease-scored), schedule (run-at-scored), dead. The queues, coordination, streams, and flow-control families ground here. The second dive opens both roles with their committed figures.

the application · one engine, one closed grammar

The keyspace under both roles

On Valkey, the braced hashtag is what keeps every key of one queue in one cluster slot — co-location by grammar, not by review. The bus’s committed keyspace line names every shape at once.

content/bcs3.1.md · F1, the grammar shape by shape · verbatimfrozen
emq:{orders}:pending | emq:{orders}:job:ORD0NgWEfAEJfs | {emq}:version | {emq}:locks -- 17 bytes before the payload

Notes on ValkeyIn a sorted set, elements with the same score are ordered lexicographically — which is why the score-zero pending set browses in mint order with no second index — valkey.io/topics/sorted-sets.

§3

The three dives

the seam → the roles → the tier

Each dive takes one part of the placement. Read them in order — the facade seam starts.

the placement

Keep one store below one facade, in two clear roles. Surfaces never depend on the store, and the store can change without them.

its BCS application

EchoCache and the EchoMQ bus over one owned client, EchoWire, both on Valkey — the near-cache derived, the bus authoritative, and the bus’s protocol owned outright.

Three dives, one placement: the seam that holds, the two roles below it, and the tier that stopped being a reservation and became shipped code. After R0.2, the next module — R0.3 · Patterns become protocol — shows how the bus’s patterns become a protocol any conforming runtime speaks.

§4

References

sources · related

Sources

Related in this course