B2.1.2 · dive 2 of 6 · module B2.1
The supervision tree.
The system runs under a one_for_one supervisor: one store per {name, namespace}, each restarted in isolation. Let-it-crash, contained.
The idea
echo_data · bcs/supervisor.exA system does not run loose; it runs under a supervisor. EchoData.Bcs.Supervisor is one_for_one over named property stores: it starts one PropertyStore child per {name, namespace} pair, each a GenServer with its own private table. The supervisor is the system’s parent, and the tree is the shape a deployment starts.
one_for_one is a containment strategy. If one store crashes — a bad message, an unexpected value — the supervisor restarts that one child and leaves its siblings untouched; a fault in the orders store never disturbs the players store. This is let-it-crash as architecture: a process that reaches a state it cannot handle dies, and a clean one takes its place, rather than corruption spreading through shared memory.
Codemojex inherits the tree. Each room is a supervised child, so a crash in one room never takes down another; the command workers that drain EchoMQ.Lanes are supervised the same way, restarted on failure without losing the lane. The supervision tree is how a system of many rooms stays up while any one room is allowed to fail.
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
- Erlang/OTP — the supervisor behaviourone_for_one over named stores: the tree that owns a system's existence
- Erlang/OTP — the gen_server behavioura system as a process: one mailbox, one private state, a message-only surface
- 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