Structure family
Coordination
Some decisions cannot merge. Two hikers cannot both hold the only gate key, and one job cannot go to two workers. Every structure in this family therefore needs the ranger station: it numbers each request, and every hiker applies the requests in that order. Each structure then uses the order for a different rule: the first claim wins, the oldest job goes first, the next volunteer takes over, or everyone approves a change.
One order, one decision
A CRDT lets each hiker settle a conflict alone and merge later. These structures cannot: a second gate-key owner would be wrong, not just different. Each one is a distributed data structure, or DDS. Each hiker sends a request to the ranger station, which acts as the sequencer. The result is final only after the station numbers the request.
This shared order is also a dependency. A hiker can show a pending request, but cannot finalize it while the ranger station is unavailable. The individual lessons show which local state appears before sequencing and which state waits for acceptance.
claims_kernel
Alice, Bob, and Carol all volunteer to hold the only gate key.
Rule: The sequencer numbers claim requests. The first accepted claim fills that key permanently; later claims cannot replace or remove it.
Open the Claims lessonordered_collection_kernel
Unlike a claim, a job can change hands. Every notebook holds the same queue of three jobs in arrival order: inspect the bridge, clear a fallen branch, and restock the first-aid cache. Alice, Bob, and Carol take work from it.
Rule: A worker takes the oldest queued job. A release returns held work to the queue tail.
Open the FifoWorkQueue lessontask_manager_kernel
Someone must staff the dispatch desk throughout the storm. Claims would make one hiker its permanent owner; here, the next volunteer takes over if the first leaves. Alice, Bob, and Carol volunteer in order.
Rule: The first connected volunteer owns the task. Leaving or disconnecting promotes the next volunteer.
Open the TaskManager lessonPactMap
Keep the current plan until everyone connected at the proposal approves the replacement or leaves.
pact_map_kernel
TaskManager let the ranger pick one hiker. Here, every hiker must agree. The accepted plan sends hikers out by the north gate. Alice proposes ridge-pass instead, and every notebook keeps north-gate until each hiker who was connected when the proposal arrived has signed off or left.
Rule: A numbered proposal copies the connected roster into its signer list. The replacement becomes readable after every hiker on that list signs off or leaves.
Open the PactMap lessonChoose who decides
| Need | Choose | Trade-off |
|---|---|---|
| One permanent owner | Claims | The owner never changes |
| Jobs in arrival order | FifoWorkQueue | Released jobs go to the back |
| One active worker with backups | TaskManager | Finishing clears the line |
| A change everyone must approve | PactMap | One silent signer delays the change |