B2.3.2 · dive 2 of 3 · module B2.3
The contract hash is the placement.
A key’s position is decided by one function, BrandedId.hash32 — the same hash that answers placement(USR0KHTOWnGLuC) = 234878118. The same placement holds across Elixir, native, Go, and Node.
The idea
echo_data · branded_champ.ex, champ_node.exEchoData.BrandedChamp is a forest — one trie per namespace, dispatched on the three-byte prefix — and the position of a key within a trie is decided by one function: EchoData.BrandedId.hash32. The same hash that answers placement(USR0KHTOWnGLuC) = 234878118 places the key in the trie, and the node code computes it from a single source, never defining its own.
One hash from one source is what lets placement be a contract rather than an implementation detail. The same hash32 positions a key here, in the BEAM’s native tables, and in any Go or Node consumer reading the structure, so the tree shape is identical across runtimes. That is the reason to reach for CHAMP over the default map: when the in-trie placement itself is part of the contract, or when the shape must be instrumented, persisted, or mirrored.
Codemojex spans runtimes, so this matters. A PLR or ROM id lands in the same slot whether the Elixir room, a Go worker, or a Node view computes it; a structure mirrored from one to another agrees without a translation step. Placement is fixed by the id and the contract hash, not by which language happens to hold the map.
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
- The Go Blog — Share Memory By Communicatingno shared state across a boundary: pass a message, never a reference
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus