What is a CRDT?
CRDT stands for Conflict-free Replicated Data Type. It's the technology that lets Heaper work offline and sync across devices without merge conflicts.
The Problem
Traditional sync systems use a central server as the source of truth. If two devices edit the same document while offline, the server has to pick one version or ask you to resolve the conflict manually — like Git merge conflicts.
How CRDTs Solve It
CRDTs are data structures designed so that:
- Every device can make changes independently
- When devices reconnect, changes merge automatically
- All devices converge to the same result, regardless of the order changes arrive
There are no merge conflicts. Ever.
How Heaper Uses CRDTs
- When you edit a note, your changes are recorded as CRDT operations
- These operations are tiny and efficient — only the delta is sent, not the full document
- When you sync, your device exchanges operations with the server or other devices
- The CRDT algorithm merges everything automatically
What This Means in Practice
- Work offline: Make changes without a connection. Everything syncs when you're back online.
- Real-time collaboration: Multiple users can edit the same document simultaneously without conflicts.
- No data loss: Even if two people edit the same paragraph at the same time, both edits are preserved.
- Fast sync: Only changes are transmitted, not full documents.
Further Reading
- Yjs documentation
- CRDT.tech — academic resources on CRDTs