Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 05 · System Design · Deeper than the interview · about 18 min to read

Watch: Neither OT nor CRDT: what is a server worth?
▶ VideoPlay it as a journeyTutor comes with a plan

Everyone edits offline: CRDTs and local-first sync

Neither OT nor CRDT
Neither OT nor CRDT · Open board

The two classic ways to merge edits from many people, and why Figma chose neither. This lesson builds the second one, the CRDT, from the smallest piece up.

Before you start. You need The log is the truth (event sourcing and CQRS): a log is a list of events that only grows, and replaying it rebuilds the state. You need The copy clerks (database replication): a copy of the data on another machine is a replica, and two places that accept writes can disagree. And Consistency and Consensus gave you the idea that two events can be concurrent, meaning neither one saw the other.

Lesson 36 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Two people, one note, no signal
  • A replica is one copy that accepts changes by itself
  • Counting likes: each replica owns one slot
  • A shopping list where add and remove can happen at once
  • Typing text: every letter gets a name that never changes
  • What you get, and what it costs
  • The G-counter, the OR-set and the sequence, run
  • Two ways to merge: state and operations
  • Operational transform, and why the two differ
  • What a CRDT cannot do
  • Sync engines and local-first apps
  • Choosing

Terms it explains: replica, convergence, G-counter, CRDT, OR-set, sequence CRDT, Common mistakes, state-based, operation-based, deltas, interleaving, moves, local-first, sync engine.

Related papers

Review System Design