B2.1 · dive 1 of 3
A system is an OTP application.
The first clause made concrete: the boundary is a supervised process. A pure core decides; a GenServer shells it; a supervisor starts one property store per namespace.
The idea
echo_data · bcs/supervisor.exThe law’s first clause — a system owns its state behind a boundary no other system reaches through — is, on the BEAM, a sentence about processes. A system is a supervised process; its state is unreachable except by message, so the runtime enforces the boundary rather than leaving it to discipline. EchoData.Bcs.Supervisor brings the system up: start_link(stores) starts one EchoData.Bcs.PropertyStore child per {name, namespace}, each a supervised boundary under one tree, and restarts a child that falls.
Inside a system the pattern is pure-core-and-shell. The decisions are total functions with no side effects; the GenServer is a thin shell that owns the ETS table and serializes access to it. A call arrives, the shell hands the relevant state to the pure core, the core returns a decision, and the shell applies it and replies. The interesting logic stays testable without a running process, and the effects live at the boundary.
The system topology is therefore a supervision tree of branded boundaries. A namespace is not a string prefix on shared rows; it is a process with its own private table and its own gate. Adding a system is adding a child to the tree, and the tree is the architecture made executable — ownership, isolation, and restart, all from the runtime.
The six dives are in the module: B2.1 · A System Is an OTP Application.
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 — Supervisorthe supervision tree the system topology is built from
- Erlang/OTP — gen_serverthe shell that owns the table and serializes access
- The Go Project — Share Memory By Communicatingthe same boundary in another runtime: a goroutine owning its state
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus