Imagine two people editing the same shared list while offline on a plane. When they land and reconnect, who wins? In most systems you get a conflict — one person's changes overwrite the other's. Someone loses their work.
Conflict-free Replicated Data Types (CRDTs) are a family of data structures, introduced by Marc Shapiro, Nuno Preguiça, Carlos Baquero and Marek Zawirski in 2011, that make this problem disappear mathematically. Each replica can accept any local edit without asking permission. When replicas sync, the merge is automatic, deterministic, and always produces the same result — no matter what order messages arrive, no matter how long replicas were offline.
The secret is not clever conflict resolution. It is choosing data structures whose mathematical properties make conflicts impossible in the first place. The merge function must be commutative (order does not matter), associative (grouping does not matter), and idempotent (applying the same update twice has no extra effect). Any structure satisfying these three laws is a CRDT, and two replicas running a CRDT are mathematically guaranteed to converge.
Comments
Loading comments...