The design of parosd is written in
docs/architecture/, and its
code is not built. The layers are built after the journal, in the order of
#1409. This page explains the design and links each
section; the rules are in the docs.
What it will be
One binary, parosd, on N machines of a cell. It serves journals to many tenants over the four calls of the journal: Write, Read, Truncateand SetLeader. When a disk or a machine is lost, the cell heals through reconfiguration, with no operator call. Cells sit in a universe, and a tenant lives in one cell.
paros eats its own food: the state of the service lives in journals, who acts is decided by SetLeader on a journal, and agreement comes from the Paxos flavors that paros-consensus builds. There is no external coordination service to run. The target design is docs/architecture/; most of what it names is at the tag below, not in the tree.
The goals
Eleven goals say what paros is for and how it is built. Each rule of the design is a consequence of one of them (docs/architecture/01-goal.md, §1.1).
- A journal service for tenants. Four calls, and a durable, ordered, fenced log. paros owns the log, never the state.
- The cell heals with nobody watching. After the faults stop, each journal is whole again within one bound, or reports a true reason.
- paros eats its own food. State is in journals, who acts is an election on a journal, and agreement is a Paxos flavor of the core.
- One shape at every level. The universe, a cell and a tenant are each a control journal, a pure fold and one coordinator.
- The person says what, the system says where. A person types names and what a journal must survive. The system chooses the machines and the ids.
- Everything can move. A namespace moves to another cell with no change of protocol.
- Layers that stand alone. Each layer is a crate that another program can use alone. The core has no tenant.
- Every role is a pure actor. A deterministic step, persist before send, and I/O only in adapters.
- Proved before built. No code before its TLA+ model, and no excuse in simulation.
- Everything simulates, and it runs in the browser. Every layer and the whole service run in the deterministic simulation, and the same code compiles to wasm.
- Easy to operate. The service operates itself: it heals and it scales with no person in the loop. What a person would do by hand, a component does.
The features of the first version stay. Its structure changes: the service becomes a stack of layers on the journal v1, and each layer is a crate with its own model and its own simulation (§4.4).
The stack
Eight layers. A layer depends only on the layers below it. Layers 0 to 5 are pure: no runtime, no I/O, and they build for wasm. Only layer 6 does I/O. The names of the crates still to build are Open.
paros-consensus · paros-host · no tenant, no cellTwo joints hold the layers apart:
- A booking becomes an
Assign. The cell records where a role runs: a booking. On the machine, a booking becomesInput::Assignof the host, and a release becomesInput::Unassign. The journal never reads a booking. The part between the two is #1424. Machines. - A coordinator changes a journal only through fenced calls. It records each action in its own control journal before it does it. Each order carries its term and names the epoch of its target, and the target refuses an old one (§3.3, rule 3).One shape at every level.
The pages
- Layers that stand alone: what each layer is, and the checks that hold the layering.
- One shape at every level: the universe, a cell and a tenant are one kit.
- Machines: format, bootstrap, admission, bookings, release, and the heal of the cell.
- Names and tokens: names for people, ids for machines, Biscuit tokens at the frontend.
- The universe: the override table, the bucket table, and a move.
The version before the rewrite
A first version ran: a daemon on each machine, a CLI, many cells, Biscuit tokens and a deterministic simulation with faults on. It showed where its foundations were too weak, so paros started again from the consensus core. The whole first version stays at the git tag v0.2.0-alpha.1: parosd, parosctl, paros-bench, the Docker Compose demo and the simulation. To run it:
git clone https://github.com/PierreZ/paros && cd paros
git checkout v0.2.0-alpha.1
docker compose up -d --build
docker compose run --rm init
docker compose run --rm parosctl tenant create acmeIts DEMO.md is the walk-through. A recap of each removed crate is in docs/archive/v0.2.0-alpha.1/.