B2 · module 5 of 6 · Relations Are Systems
Relations Are Systems.
A relation is its own owning process: EchoData.Bcs.EdgeStore keys an edge by the tuple {subject, object} rather than a list on either endpoint, gates both ends against their namespaces, and owns a forward and a reverse index maintained together.
Three dives: the relation as its own system, both ends gated at every door, and the dual private indexes that answer traversal both ways without a scan.
The three dives
each a leaf, the teachingA relation is a system
A 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…
Both ends are gated
Every door into an edge checks both ends. A store is created for a relation between two namespaces — a subject namespace and an object…
B2.5.3Dual private indexes
Traversal in both directions wants two orderings, so the store keeps two tables. A forward :ets ordered_set is keyed…
The module, in one law
echo_data · bcs/edge_store.ex, edges.exB2.5 reads a relation as a system. EchoData.Bcs.EdgeStore is one owning process for one kind of edge, keyed by the tuple of names {subject, object} rather than a list embedded in either endpoint; both ends are gated against their namespaces before any write; and the store owns two :private ordered sets — a forward index for traversal from the subject and a reverse index for traversal from the object — maintained together by the single owner. Three dives: the relation as its own system, both ends gated at every door, and the dual private indexes that answer traversal both ways without a scan. Grounded in EchoData.Bcs.EdgeStore — with the same composite-key-is-the-index idea in EchoData.Edges — and pointed at the membership and ownership graphs a Codemojex room keeps.
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
- King — Announcing Snowflake (2010)the branded endpoints whose namespace each gate checks
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus