B2.5.3 · dive 3 of 3 · module B2.5
Dual private indexes.
Two :private ordered sets — fwd keyed {subject, object} for from, rev keyed {object, subject} for to — written together by one owner, so they cannot disagree. degree counts fwd without a scan.
The idea
echo_data · bcs/edge_store.exTraversal in both directions wants two orderings, so the store keeps two tables. A forward :ets ordered_set is keyed {subject, object} and answers from — the objects of a subject, ascending; a reverse table is keyed {object, subject} and answers to — the subjects of an object. degree counts a subject’s forward rows without listing them.
Both tables are :private and maintained together. A single owner writes the forward and reverse rows in the same link, deletes both in the same unlink, and exports neither, so the two indexes cannot disagree — there is no path by which one is updated and the other is not. The store hands out answers to from and to, never a table to read.
Codemojex reads its membership both ways without a scan. From a player, the rooms they are in; from a room, the players in it; the count of a player’s rooms without walking them — each a bounded key walk on one of the two tables. The same composite-key-is-the-index idea runs the parent-to-children hierarchy in EchoData.Edges, where a {parent, child} snowflake pair keeps a parent’s children contiguous and in creation order.
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
- 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
- Helland — Life Beyond Distributed Transactions (CIDR 2007)entities and the relationships a system keeps between them, as data
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus