jonnify·bcs /bcs/elixir-core/the-champ-database/a-tier-not-a-truth

B2.3.3 · dive 3 of 3 · module B2.3

A tier, not a source of truth.

CHAMP is an L0 memory tier rebuildable from the Graft floor, never a separate truth. The default is BrandedMap; CHAMP earns its place when placement is a contract or the shape must be mirrored.

A view folded from the Graft commit log; the choice between the native map and CHAMP. Select a part.
Graft (L2)commitcommitfold CHAMP (L0, in heap)rebuild_view folds the streama view, never a source of truth BrandedMapby defaultBrandedChampwhen placement is a contract
readout · Select a part. ChampView folds a Graft volume’s commit log into a fresh map; the floor is the truth; choose BrandedMap by default and CHAMP when placement-as-contract or mirroring is the point.
§1

The idea

echo_data · champ_view.ex, branded_champ.ex

CHAMP is fast in-heap state, and the layered design is firm about what that makes it: an L0 memory tier whose contents are rebuildable from the durable floor, never a separate source of truth. EchoData.ChampView is that rule as code — it folds a stream of decoded entries from a Graft volume into a fresh map, so a view can be re-derived after a crash with no bespoke recovery path.

The default is the other map. EchoData.BrandedMap rides the BEAM’s native hash-array-mapped tries and wins the general case, so it is what a store reaches for unless it has a reason not to; CHAMP earns its place only where placement-as-contract or cross-runtime mirroring is the point. Stated plainly: choose the native map for speed, the branded CHAMP for a placement you can pin and rebuild.

Codemojex treats its CHAMP views as derived. The players or rooms map is an in-memory projection; after a crash a server swaps in a whole map re-folded from the Graft commit log, atomically, and play resumes. The floor of B5 is the truth; the trie is a tier over it that any node can rebuild.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related