| 1 | # Simulations |
| 2 | |
| 3 | Confidence in celld is built up in several ways. This page describes one of |
| 4 | them: end-to-end simulations on live fleets, where real nodes coordinate |
| 5 | through a real object store under real workloads, and we observe what actually |
| 6 | happens when things go wrong. |
| 7 | |
| 8 | Simulations are empirical evidence at a scale and realism that reasoning alone |
| 9 | cannot reach. Running the whole system on many machines, with real storage |
| 10 | latency and real network partitions, and then breaking it deliberately, shows |
| 11 | whether celld's guarantees hold in practice and not only by design. This page |
| 12 | records those runs in broad strokes and grows as we run more of them, across |
| 13 | larger fleets, denser cell populations, longer partitions, and more varied |
| 14 | failure modes. |
| 15 | |
| 16 | Every result shares the same substrate: a fleet of celld nodes coordinating |
| 17 | only through one S3-compatible bucket, one SQLite database per Durable Object, |
| 18 | synchronous durability — a write is replicated to the bucket before its response |
| 19 | is released, so an acknowledged write is durable (RPO=0) — and a single |
| 20 | authoritative writer per cell fenced by an epoch in the object-store path. Each scenario attacks that substrate at a |
| 21 | different seam. Faults are injected between verification passes that fetch cells |
| 22 | through arbitrary nodes and check their durable state exactly — status, body, |
| 23 | and full message ledger — so every run has a clean before-and-after. A cell may |
| 24 | go briefly unavailable while ownership moves, but its committed state must |
| 25 | survive intact and be served again from a live node. |
| 26 | |
| 27 | ## What survives |
| 28 | |
| 29 | **A hard process crash loses no acknowledged write.** Kill a node's process |
| 30 | outright — even mid-write-stream — and its resident cells are orphaned instantly. |
| 31 | Because the output gate holds each write's response until it is durable, every |
| 32 | acknowledged write is already in the bucket: a surviving node re-acquires each |
| 33 | cell and serves it from replicated state, at a bounded time-to-availability |
| 34 | measured as a distribution. |
| 35 | |
| 36 | The direct test is deliberately adversarial: issue writes back to back, `SIGKILL` |
| 37 | the process mid-stream, then *delete the node's local database* so recovery can |
| 38 | only come from the bucket, and cold-restore the cell. Twenty writes acknowledged |
| 39 | and killed this way recover all twenty; an eight-cell run of 156 acknowledged |
| 40 | writes recovers all 156. **Zero acknowledged writes lost, across every run.** |
| 41 | Before the output gate, the same kill dropped the recently-acknowledged writes |
| 42 | that had not yet replicated — which is exactly what the gate is there to prevent, |
| 43 | and exactly what these runs check for on every fault. |
| 44 | |
| 45 | **A returning partitioned owner cannot corrupt state.** Freeze a node so it |
| 46 | still believes it owns its cells, write to those same cells through peers, then |
| 47 | thaw it. It discovers its lease has moved and refuses to serve stale data |
| 48 | rather than resurrect it. The peer writes land exactly once, the original state |
| 49 | is intact, and ledgers stay consistent — at most one writer per epoch, enforced |
| 50 | through the bucket, even against an owner that comes back to life. |
| 51 | |
| 52 | **A node that cannot replicate stops owning.** Cut a node off from the bucket so |
| 53 | it can no longer prove durability, and it self-fences rather than accept writes |
| 54 | it cannot replicate. "I can't replicate" is treated as "I must stop owning," not |
| 55 | as a degraded-but-serving state. |
| 56 | |
| 57 | **Losing a whole host is a non-event for the data.** Halt an entire node at the |
| 58 | provider level, mid-workload, and its cells move to survivors; when the host |
| 59 | returns it rejoins cleanly with no duplicate residency. |
| 60 | |
| 61 | Across these scenarios, no committed cell state has been lost or corrupted, and |
| 62 | between every fault the verification sweeps return zero body, status, or |
| 63 | missing-message failures. |
| 64 | |
| 65 | ## A few numbers we trust |
| 66 | |
| 67 | Confidence is also quantitative. These are the simplest measurements an engineer |
| 68 | tends to ask for first; each carries the condition it was taken under, because a |
| 69 | number without its conditions is a rumor. Fuller ledgers live in the project's |
| 70 | spec sheet. |
| 71 | |
| 72 | - **A warm resident request is local.** A request to an already-resident Durable |
| 73 | Object does zero bucket operations and returns in **p50 ~1.1 ms, p99 ~7 ms** |
| 74 | (fixed-host measurement). Only cold activation pays for object storage. |
| 75 | - **A durable write costs one bucket round-trip.** That round-trip *is* what |
| 76 | RPO=0 means — the response is held until the write is in the bucket — so the |
| 77 | single-write latency floor is the storage round-trip, not something the engine |
| 78 | can optimize away. Concurrent writes to one cell batch onto a shared upload, so |
| 79 | per-cell throughput is not one-round-trip-per-write. |
| 80 | - **Ten small nodes held real scale.** A ten-node fleet of 4-vCPU/8-GB machines |
| 81 | carried **10,000 resident cells and 20,000 concurrent WebSockets**, and after |
| 82 | halting two of the ten, every cell's data was available again on a survivor |
| 83 | within ~11 s at the tail (with reserve headroom). |
| 84 | |
| 85 | ## The failure edges we intend to find |
| 86 | |
| 87 | Confidence also means knowing where a policy stops holding, so those edges are |
| 88 | recorded rather than tuned away. The clearest one is reserve headroom: a fleet |
| 89 | packed to its hard resident ceiling has nowhere to place cells displaced by a |
| 90 | node loss, so simultaneous multi-node failure at the ceiling degrades where a |
| 91 | fleet with headroom does not. Measuring both sides of that line — healthy |
| 92 | restoration with reserve, and the red case without — is part of the work, not |
| 93 | an embarrassment to hide. |