jonnify·echd /echd/bus/streams/the-polyglot-seam

echd — Echo on Encore · E3.2 · dive

The Polyglot Seam

A subscription lives in Valkey, not in a runtime — so joining a group is a command any language issues, and the polyglot promise stops being a slogan and becomes server state.

Vision · real substrate

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.

§1

The dive

docs/echo_mq/emq.streams.md:42

The polyglot claim of the bus is easy to state and easy to doubt: any runtime that speaks the protocol is a first-class peer. The stream tier is where it stops being a slogan, because a consumer group makes the claim concrete. A subscription is not an object inside the BEAM; it is state that lives with the stream, on the Valkey server. Joining it is issuing XREADGROUP against a key — something a Go program, a Python worker, and a BEAM node do identically, because there is nothing runtime-specific to join.

Turn that around and the supersession is sharp. PubSub's fan-out lives in the runtime that owns the topic, so a second language needs a bridge, and a subscriber that blinks loses whatever arrived while it was gone. The stream tier keeps the subscription — cursor, pending lists, and all — on the server, so a non-BEAM consumer stands in the same group as the BEAM consumers, drains the same pending list, and gets the same at-least-once guarantee. The seam is not a translation layer; it is the absence of one.

§2

One group, many runtimes

docs/echo_mq/emq.streams.md:42
One group, many runtimes · the seam is server state · hover to read
one stream, one group — consumers in any language XADD → group: orders BEAM Go Python Rust PubSub: fire-and-forget · no shared, durable subscription across languages the group is server state, not a library — so any client joins it
One group, in Valkey. A consumer group is not a client abstraction; it is state that lives with the stream on the server — the cursor and the pending lists included. XREADGROUP, XACK, and reclaim are the same commands whatever issues them, so to join the group is to join from anywhere.
Any language. Every runtime ships a Valkey client, and the tier's payloads are branded claims — trivial to decode. A Go worker, a Python consumer, and a BEAM node read one stream as equal members of one group; the conformance suite stands a non-BEAM reader in the group to prove the seam holds.
What PubSub could not do. Encore's PubSub is fire-and-forget with no shared, durable subscription: a second language needs its own bridge, and a disconnect drops messages. The stream tier's group is durable and server-side, so polyglot fan-out is the default, not an integration to build.

Hover or focus a part to read it; click to pin. Without scripting, all three read in sequence.

§3

The seam is the absence of a bridge

docs/echo_mq/emq.streams.md:42

It is worth being precise about what makes this polyglot, because it is not a feature that was added — it is a bridge that was never needed. A conventional broker offers per-language SDKs: a Go library, a Python library, each re-implementing the client's half of a bespoke protocol, each a place for the languages to disagree. The stream tier has no such surface. The protocol is Valkey commands, the subscription is server-side group state, and the payload is a branded claim a few bytes wide. A new language is not onboarded; it already has a Valkey client, so it already has everything it needs.

This is the streams-shaped form of the wire rule from the previous module: there, the point was that the protocol is the database's own wire, so any runtime that speaks it is a peer. Here the point is narrower and more concrete — the subscription is on the wire too, so peers do not merely issue the same commands, they share the same durable delivery. A Go consumer and a BEAM consumer are not two systems integrated; they are two members of one group, and the group cannot tell them apart. The conformance suite makes the equality a test rather than a promise, standing a non-BEAM reader in the group and draining the same pending list the BEAM does.

§4

The rule

one line to carry

The polyglot rule — the subscription lives in Valkey, so any language joins the same group. PubSub's fan-out dies at the runtime boundary; a consumer group is server state — one cursor, one pending list — so a Go reader and a BEAM node share one stream and one at-least-once guarantee, with no bridge between them.

§5

Doors

the seam, proven
§6

References

sources · related

Sources

  • Valkey — Streamsconsumer groups as server-side state every client shares, whatever the language
  • Valkey — Pub/Subthe fire-and-forget primitive with no shared subscription — the limitation the seam removes

Related