B2.5.1 · dive 1 of 3 · module B2.5
A relation is a system.
An edge is its own owning process, keyed by the tuple {subject, object} — not a list embedded in either endpoint. Player-in-room is a store, not a field on a player or a room.
The idea
echo_data · bcs/edge_store.exA relation is not a field on either thing it relates; it is a system of its own. EchoData.Bcs.EdgeStore is one owning process for one kind of edge, and the edge is a row keyed by the tuple of names — {subject, object} — carrying its own properties. Portfolio holds asset, player in room: a row in a store, not a list embedded in the portfolio or the room.
Keeping the relation outside both endpoints is what keeps the endpoints clean. A subject does not grow a list of its objects and an object does not grow a list of its subjects; neither has to be rewritten when a membership changes, and neither can drift out of step with the other. The single fact — this subject relates to this object — lives in one place, owned by one process.
Codemojex makes each relationship its own store. Player-in-room is one EdgeStore, tile-ownership another; a room crashing does not touch the ownership graph, and a new kind of relation is a new supervised store rather than a new field threaded through every entity. A relation is a system, supervised and addressed like any other.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- Helland — Life Beyond Distributed Transactions (CIDR 2007)entities and the relationships a system keeps between them, as data
- Erlang/OTP — the ets modulethe :private :ordered_set tables and the match specs a relation traverses
- The Go Blog — Share Memory By Communicatingthe indexes a relation owns and exports to nobody
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus