Structure family

Registers

The camera list is settled. Now the hikers need one answer: is the Eagle Creek trail open? Alice reports open and Bob reports closed, before either sees the other's report. The three registers below handle that in three steps: choose one answer by time, keep both answers, or let the ranger station number every version.

An empty trail-status board above a single-report clip, a paired-report clip, and an archive with two reading tabs.
CRDT Complexity Introductory

LWWRegister

Use the time and author to choose one answer.

lww_register_kernel

Alice reports Trail open while Bob reports Trail closed. A last-writer-wins register keeps one value. The hikers keep the value with the later time. If the times match, they compare the authors' names.

Carol can receive the reports in either order and still choose the same value. The losing report is discarded, so readers do not see the disagreement.

Best for

  • Small settings that need one predictable answer
  • Values where people trust timestamps to select one answer
Updates
Text with a time and author
How copies combine
Later time, then author
What it remembers
The answer, time, and author
Open the LWWRegister lesson
CRDT Complexity Intermediate

MvRegister

Keep competing answers until someone resolves them.

mv_register_kernel

Neither report is safe to discard. The multi-value register keeps both Alice's and Bob's answers. Carol sees the disagreement instead of a silent winner.

After Carol inspects the bridge, her next report can replace the answers she saw. A report she has not seen still remains.

Best for

  • Reviews where a person must resolve competing answers
  • Values where losing a valid report would be harmful
Updates
Answers tagged with the answers they replace
How copies combine
Keep every answer that no later answer replaced
What it remembers
Each remaining answer and its history
Open the MvRegister lesson
DDS Complexity Advanced

RegisterMap

Keep numbered versions and choose how to read them.

register_collection_kernel

Alice and Bob submit reports before either sees the other. Here the ranger station returns: it numbers and stores both versions. One reading method keeps the first answer that had no competition. Another returns the newest numbered answer.

The collection does not compare clocks or combine the answers. It keeps the numbered versions so the reader can choose between the two rules.

Best for

  • Named lines that need a first or newest answer
  • Shared work where old numbered versions still matter
Updates
Answers numbered by the ranger station
Read rules
First uncontested or newest
What it remembers
Answers and their numbers
Open the RegisterMap lesson

Choose what disagreement means

NeedChooseTrade-off
Use time to select one answerLWWRegisterDiscard the other answer
Keep competing answersMvRegisterSomeone must resolve them later
Choose from numbered answersRegisterMapThe ranger station must number them