jonnify·bcs /bcs/elixir-core/relations

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 five gates, mapped to the dives. Drawn in transcript order. Select a gate to read its verbatim line and the dive that teaches it.
E1 surface dive 1 E2 gates dive 1 E3 retire dive 2 E4 traverse dive 3 E5 unlink dive 3
readout · Select a gate to read its verbatim line and the dive that teaches it. Five gates over one relation store; the full transcript is frozen in §2 below, the dives are mapped in §3.
§1

The most-asked join

content/bcs2.5.md · Why

Who 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.

THE MODEL

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.

THE EDGE

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 INDEXES

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.

THE DEBT

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.

§2

The proof

content/bcs2.5.md · quoting bcs_rung_2_5_check.out

The full committed transcript, verbatim:

content/echo_data/runtimes/elixir/bcs_rung_2_5_check.out · verbatimfrozen
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.

§3

The dives

three lessons, fixed by the chapter spec

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).

§4

References

sources · related

Sources

Related