jonnify·bcs /bcs/elixir-core/otp-application/existence-not-data

B2.1.3 · dive 3 of 6 · module B2.1

The supervisor owns existence, not data.

The supervisor owns lifecycle; the system owns its private state. A restart yields a fresh, empty process that rehydrates from the store and the floor, by id.

Existence owned by the supervisor, data by the system, recovery from below. Select a part.
the supervisorowns: start, restart, shutdown the system (process)owns: its :private tablethe supervisor does not read this restart → fresh, empty tablerehydrate from EchoStore + the floor, by id
readout · Select a part. The supervisor owns lifecycle, not data; a restart gives a fresh empty process; durable state rehydrates from EchoStore and the floor, by branded id.
§1

The idea

echo_data · bcs/supervisor.ex, property_store.ex

A supervisor owns one thing and deliberately not another. It owns existence — when a child starts, when it restarts, when it shuts down — the lifecycle of the process. It does not own the child’s data: the private ETS table belongs to the GenServer, not to the supervisor, and the supervisor neither reads it nor restores it. Existence and state are split on purpose.

The split is what makes restart safe. When a store crashes and the supervisor brings back a fresh process, that process starts with an empty table — the supervisor did not, and must not, carry the old state forward, because the old state is exactly what may have been corrupt. Durable state is recovered from below, not from the supervisor: the system rehydrates from the store and the floor, which are the things designed to survive a process.

Codemojex makes the recovery visible. A restarted room is a brand-new process with an empty board, and its durable state — the round, the scores, the wallet — is rehydrated from EchoStore and the persistence floor of B5, keyed by the room’s branded id. The supervisor guarantees the room exists again; the store and the floor guarantee it remembers. Existence is the supervisor’s; memory is the system’s.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related