Prerequisites
What it is
A conflict-free replicated data type is a data structure designed so replicas can update independently and merge into a consistent result.
Why it matters
Collaborative apps, offline-first clients, and multi-region systems need to accept changes without always coordinating through one leader.
How it works
CRDTs encode operations or state with merge rules that are associative, commutative, and idempotent. That means replicas can receive changes in different orders and still converge.
The merge rules guarantee convergence: operations can arrive in any order, be duplicated, or be replayed, and every replica ends up in the same state.
When to use it
Use CRDTs for collaborative editing, shared counters, sets, maps, presence-like state, and offline-capable apps where conflicts must resolve automatically.
Tradeoffs / failure modes
CRDT metadata can grow, text editing CRDTs are subtle, and automatic convergence does not always match human expectations.
Tiny example
Two users edit a note offline. When both reconnect, their CRDT operations merge without one edit overwriting the other.
Related guides and systems
See Collaborative Real-Time Editing and Google Drive.
Seen in deeper dives
Related concepts
Operational Transform
Transform concurrent edits so collaborative documents preserve user intent.
Pub/Sub
Broadcast events from publishers to many independent subscribers.
WebSocket
Keep a bidirectional connection open for low-latency client and server messages.