echd — Echo on Encore · E3.2
Streams Supersede PubSub
A topic is a log and a subscription is a group — so a message is retained, acknowledged, replayable, and readable from any language, where PubSub delivers once and forgets.
echd speaks in the present tense over a build ladder. Every module, verb, key, and port named on this page is real; the composition into one standing platform is the vision the ladder builds.
The module
docs/echo_mq/emq.streams.md:29-42Encore's PubSub is fire-and-forget: a topic delivers to whoever is subscribed at that instant, and a subscriber that was down misses the message forever. The stream tier replaces it with something stronger, and owns the difference. A topic becomes a Valkey stream — an append-only, mint-ordered log — and a subscription becomes a consumer group. A message is not gone the moment it is delivered; it is retained, acknowledged, and replayable.
Turn PubSub into a stream and three properties arrive together. A consumer group lets many workers share one topic without seeing each other's entries — XREADGROUP distributes, XACK completes. At-least-once falls out of the pending-entries list: a delivered entry stays pending until acknowledged, and XAUTOCLAIM rescues the work of a consumer that died. And because the group is a Valkey construct rather than a library, the seam is polyglot — a non-BEAM reader stands in the same group as the BEAM. Retained, replayable, at-least-once, any language: the four things PubSub is not.
The stream tier, drawn
hover a facetXREADGROUP hands each new entry to exactly one consumer in the group, so N workers share the load without seeing each other's entries, and XACK marks an entry done. Add a consumer and throughput scales.XAUTOCLAIM hands its work to a living one after an idle timeout. Retention is policy — XTRIM bounds the log by length or minimum id — and a reader replays from any id. PubSub forgets; the stream tier remembers.Hover or focus a facet to read it; click to pin. Without scripting, all three read in sequence.
The dives
three moves downConsumer Groups
A subscription is a group — XREADGROUP partitions the log, XACK completes, the group tracks who has what.
D2At-Least-Once
The pending-entries list, XAUTOCLAIM for the dead, XTRIM retention, replay from any id — PubSub forgets, this remembers.
D3The Polyglot Seam
One group, any language — why a Go consumer and a BEAM node share a stream PubSub could never fan out.
Doors
the tier in depthEchoMQ — the protocol, in depth
The stream tier verb by verb: XADD, XREADGROUP, XACK, XAUTOCLAIM, and the retention and replay commands.
the log, the group, the pending list — the tier this module compresses.
/redis-patternsRedis Patterns, Applied
Streams as a pattern: consumer groups, at-least-once delivery, and the reliable fan-out PubSub cannot give.
groups over pub/sub — when durability and replay decide the choice.
References
sources · relatedSources
- Valkey — Streamsthe log, consumer groups, XACK, and the pending-entries list the stream tier rides
- Valkey — Pub/Subthe fire-and-forget primitive the stream tier supersedes — no retention, no acks, no replay
Related
- EchoMQ — the protocol, in depththe stream tier at full resolution
- E3.1 — One Bus, Twelve Familiesthe protocol and keyspace these streams ride
- E3 — The Bus — EchoMQ Supersedesthe chapter this module sits in
- echd — the course homethe supersession switchboard