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 gate key at a duty desk beside inspection cards, a dispatch headset and roster, and a separate signoff sheet.

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.

DDS Complexity Intermediate

Claims

Choose one permanent claimant for a named responsibility.

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 lesson
DDS Complexity Advanced

FifoWorkQueue

Dispatch trail jobs in the order they entered the queue.

ordered_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 lesson
DDS Complexity Advanced

TaskManager

Assign one active worker and keep ordered replacements ready.

task_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 lesson
DDS Complexity Expert

PactMap

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 lesson

Choose who decides

NeedChooseTrade-off
One permanent ownerClaimsThe owner never changes
Jobs in arrival orderFifoWorkQueueReleased jobs go to the back
One active worker with backupsTaskManagerFinishing clears the line
A change everyone must approvePactMapOne silent signer delays the change