B2.5 · Relations Are Systems — manuscript chapter 2.5
The join, given an owner.
Portfolio holds asset is a row keyed by a tuple of names, owned like any other
property table, never an id list embedded in either endpoint. The EdgeStore is one
relation as one process — both ends gated, forward and reverse indexes private to the owner, six verbs
exported and nothing else.
The chapter is content/bcs2.5.md; the rung behind it is bcs2.5, and its committed
transcript closes PASS 5/5. The rung does something no previous rung has done: it executes a
supersession on stage — gate E3 pays the label Chapter 2.2 shipped.
The most-asked join
content/bcs2.5.md · WhyWho holds ESZ6 is the desk's most-asked join, and the embedded representation cannot answer it: a positions map inside each balance row makes the forward read free and the reverse read a scan of every portfolio in the store — the reach-through wearing a convenience's clothes, exactly as the part preface warned. The lineage of the fix is the oldest citation in this series: Codd's 1970 model treats a data bank as “a collection of time-varying relations”, and his normalization procedure is literally the E3 gate. Fifty-six years later the parent is a balance row, the nonsimple domain is a positions map, and the promoted relation is a supervised process — but the procedure is his, step for step.
One relation kind is one system
The :holds relation: subjects gated PRT, objects gated AST,
declared at start_link — gated by E2 at both ends.
A pair's facts live on the edge
An edge is {subject, object} → props; the quantity of a holding belongs to the
holding, not to the portfolio and not to the instrument.
The system owns its indexes
The reverse table is maintenance, not surface — no export names it; reverse traversal is a verb
(to/2), not a table — gated by E1.
Interim labels are paid on stage
Chapter 2.2 declared the embedded map interim and named its supersessor; E3 executes the retirement as a gate, not a footnote.
The proof
content/bcs2.5.md · quoting bcs_rung_2_5_check.outThe full committed transcript, verbatim:
boot: the holds relation is its own system -- PRT subjects, AST objects, indexes private E1 surface ok -- the relation's surface: link, unlink, props, from, to, degree -- and its indexes are nobody's business E2 gates ok -- both ends gated: subject must be PRT, object must be AST -- {:error, :namespace} on either violation E3 retire ok -- the interim representation retired: positions struck out of the balance row and copied down as edges -- the 2.2 label is paid E4 traverse ok -- forward 200 ascending with a 10-edge page head; reverse finds all 50 holders, ascending E5 unlink ok -- unlink removes both directions atomically: degree 199; the reverse index no longer lists the subject PASS 5/5
The system lives at runtimes/elixir/lib/echo_data/bcs/edge_store.ex; the
supervisor composes it like any store — a {name, relation, subject_ns, object_ns} child
among children. The boot line states the shape: the holds relation is its own system -- PRT
subjects, AST objects, indexes private. For the desk, the contract is six verbs and one rule — a
pair's facts go on the edge: the positions blotter is from/2, the holders report is
to/2, the concentration check is degree/2 — three joins that were a scan, a
denormalization, and a batch job in the embedded world.
The dives
three lessons, fixed by the chapter specThe Edge Is the Relation
The :holds model — one relation kind is one system; an edge is
{subject, object} → props. E1 — six verbs, indexes nobody's business; reverse
traversal is a verb (to/2), not a table. E2 — both ends gated: an ORD
subject refused, a PRT object refused, each {:error, :namespace}.
The Supersession, Performed
E3 — Codd's normalization on stage: positions struck out of the balance row and copied down as edges; the 2.2 label is paid. The decision generalized: a representation shipped as interim names its chapter, and that chapter performs the migration in a rung, not a footnote.
B2.5.3Traversal and Coherence
E4 — forward 200 ascending with a 10-edge page head; reverse finds all 50 holders, ascending — the acquisition timeline, free. E5 — degree 199; one writer, one callback, dual indexes coherent.
Boundaries, taught across the dives: one relation kind per store — a second relation
is a second system, not a kind column; edge windows wait for their review gate; no
cardinality limits; single node, one writer. Siblings in Part II: The
CHAMP Property Database (B2.3) and Archetypes and
Composition (B2.4).
References
sources · relatedSources
- Codd, E. F. — A Relational Model of Data for Large Shared Data Banksrelations as first-class; the normalization procedure gate E3 performs
- Erlang/OTP — the ets moduleordered_set term-order traversal over tuple keys; match specifications
Related
- B2 — The Elixir BCS Corethe chapter landing; the Part II arc
- B2.2 — Property Stores on ETSthe superseded interim representation; the label E3 pays
- B2.3 — The CHAMP Property Databasethe forest that keeps edge history the day it is asked for
- B2.4 — Archetypes and Compositionthe module before this one in the Part II arc
- B1 — Ideas Behind the Systemthe order theorem the traversal rides
- Functional Programming in Elixirthe umbrella where echo_data lives