Local-First Software and CRDTs: Apps That Work Offline and Sync Seamlessly
Short answer
Local-first software keeps the primary copy of the user’s data on their own device, so apps load instantly, work offline and sync changes with other devices and collaborators in the background. Conflict-free replicated data types (CRDTs) make this possible by letting concurrent edits merge automatically and consistently. Libraries and sync engines have made the approach practical for notes, design, collaboration and field apps.
Key takeaways
- Local-first means the device holds the primary data; the server helps sync.
- Users get instant UI, offline use and ownership of their data.
- CRDTs merge concurrent edits automatically without a central lock.
- It fits collaborative and offline-heavy apps, not every app.
What does local-first mean?
The term was popularised by the 2019 essay “Local-first software” from the research lab Ink & Switch. In a typical cloud app, the server is the source of truth and the device shows a temporary view. In a local-first app, the device stores the real data, every action applies locally immediately, and synchronisation with other devices or a server happens in the background.
Why is local-first gaining popularity?
- Speed: reads and writes are local, so the interface feels instant.
- Offline: the app works on planes, in basements and in areas with weak connectivity.
- Collaboration: real-time multi-user editing comes naturally.
- Resilience: the app keeps working if the server is down.
- Ownership and privacy: users keep their data, and end-to-end encryption is easier.
What are CRDTs?
A conflict-free replicated data type (CRDT) is a data structure designed so that copies edited independently on different devices can always be merged into the same result, in any order, without asking a server who wins. There are CRDTs for counters, sets, maps, lists and collaborative text.
| Approach | How conflicts are handled |
|---|---|
| Last-write-wins | Simple, but can silently lose edits |
| Operational transformation | Central server transforms concurrent operations (classic collaborative editors) |
| CRDTs | Mathematically guaranteed convergence, works peer-to-peer and offline |
Which tools help build local-first apps?
Libraries such as Automerge and Yjs provide CRDT documents for JSON-like data and rich text. Newer sync engines keep a local database (often SQLite or IndexedDB in the browser) in sync with a server database. Pick based on your data model: documents and text suit CRDT libraries, while relational business data often suits a sync engine.
When is local-first a bad fit?
- Data that must be strictly authoritative, such as bank balances and stock levels, needs server validation.
- Huge datasets that cannot fit on a device.
- Strict access-control changes that must take effect instantly everywhere.
- Simple apps where a normal API is easier to build and maintain.
Action checklist
Tick items off as you go. Progress is saved in this browser only.
Frequently asked questions
What is local-first software?
Local-first software stores the primary copy of data on the user’s device, works offline and syncs changes with other devices and collaborators in the background, giving instant performance and data ownership.
What is a CRDT?
A conflict-free replicated data type is a data structure that lets multiple copies be edited independently and then merged automatically into the same consistent result.
What is the difference between offline-first and local-first?
Offline-first focuses on apps continuing to work without a connection. Local-first goes further, treating the local copy as the primary data and emphasising collaboration and user ownership.
Are CRDTs used in real products?
Yes. CRDT techniques are used in collaborative editors, design and whiteboard tools, note-taking apps and databases that support multi-region or offline replication.
Is local-first secure?
It can be very secure, since data can be end-to-end encrypted on devices, but you must still handle device loss, access control and server-side validation for sensitive operations.