B7.1.1 · dive 1 of 3 · module B7.1
Branded ids are the keys.
Every Codemojex entity is a branded id minted by EchoData.BrandedId; the id is the primary key in Postgres and the address in every other layer, anchored by placement(USR0KHTOWnGLuC) = 234878118.
The idea
codemojex · the branded modelEvery entity in Codemojex is a branded id, minted by the same EchoData.BrandedId the course has used throughout: three uppercase letters of namespace and eleven base62 characters of a snowflake, fourteen characters of text. The player is a USR and a PLR, the room a ROM, the game a GAM, a guess a GES, a payment an OTX — each kind named once, at its boundary.
That id is the primary key in Postgres: one column on every table, no separate surrogate and no join key invented for the database’s sake. It is also the address in every other layer — the cache key, the lane name, the leaderboard member, the value a channel sends — so a row, a cached entry, and a queued job all name the same thing the same way. The contract that makes this safe is the one proven at boot, placement(USR0KHTOWnGLuC) = 234878118, the same on every node.
The reference implementation leans on this in the direction the rest of the game depends on: because an id carries its kind, a system can gate what it accepts before it touches a tier, and two systems on two machines agree on what an id means without sharing a table. The branded id is the smallest unit of the architecture, and it is the key.
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
- King — Announcing Snowflake (2010)the snowflake the branded id encodes, the same on every node
- Helland — Life Beyond Distributed Transactions (CIDR 2007)entities keyed by id, and a record of truth a game can audit
- The Go Blog — Share Memory By Communicatinga boundary that passes a message, not a reference to private state
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus