Free module
Local-first software and CRDTs
Learn how local-first apps merge offline edits: build CRDT counters, sets, text, vector clocks and tombstones by hand in Python, with checked exercises.
The lessons
Each lesson is free and interactive. Press Start lab to run its commands in a live lab and to sit its quizzes and tasks, with no account needed.
1 · Container lab
Why local-first, and how sync loses edits
I can explain why a last-writer-wins sync loses edits.
Read the lesson2 · Container lab
Counters that merge: G-Counter and PN-Counter
I can merge two counter replicas so that every replica gets the same total.
Read the lesson3 · Container lab
Registers and sets: what add wins means
I can merge two replicas of an observed-remove set.
Read the lesson4 · Container lab
Text that merges: sequence CRDTs
I can merge two replicas of a text whose characters carry positions.
Read the lesson5 · Container lab
Vector clocks, operations and deltas
I can compare two vector clocks and say which change happened first.
Read the lesson6 · Container lab
Tombstones, compaction and real CRDT libraries
I can decide which tombstones every replica has seen and can safely drop.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.