B2 · module 3 of 6 · The CHAMP Property Database
The CHAMP Property Database.
A persistent branded-id map over a forest of tries, one per namespace: a new version shares every untouched subtree with the old, placement is decided by the one contract hash, and the structure is a memory tier rebuilt from the durable floor.
Three dives: structural sharing as the snapshot mechanism, the contract hash as the placement function, and the tier-not-truth discipline — the crossover against the default map stated both ways.
The three dives
each a leaf, the teachingStructural sharing
A CHAMP is a persistent map: updating it returns a new version while the old one stays valid and unchanged. It does this by sharing — a new…
B2.3.2The contract hash is the placement
EchoData.BrandedChamp is a forest — one trie per namespace, dispatched on the three-byte prefix — and the position of a…
A tier, not a source of truth
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…
The module, in one law
echo_data · branded_champ.ex, champ_node.ex, champ_view.exB2.3 reads the CHAMP property database — a persistent branded-id map over a forest of tries, one per namespace. A new version shares every untouched subtree with the old, so snapshots are the old root kept; placement within a trie is decided by the one contract hash, identical across Elixir, the native tables, and any Go or Node consumer; and the structure is an L0 memory tier, rebuildable from the Graft floor rather than a source of truth. Three dives: structural sharing, the contract hash as the placement function, and the tier-not-truth discipline. Grounded in branded_champ.ex, champ_node.ex, and champ_view.ex, and pointed at the game snapshots Codemojex re-derives.
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
- Steindorfer & Vinju — CHAMP (OOPSLA 2015)the compressed hash-array-mapped prefix tree, two bitmaps per node
- King — Announcing Snowflake (2010)time-ordered ids whose key order is mint order
- Helland — Life Beyond Distributed Transactions (CIDR 2007)durable entities a restarted system rehydrates by name
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus