Learning Center
Local-first data
Local-first software keeps the primary copy of data on the user's devices. Learn how CRDTs and replicated documents merge, where app data is stored on a phone, and how sharing and deletion work.
Basics
What is local-first software?Software that keeps your data on your devices first, and syncs as a helper.→What are the seven ideals of local-first software?The essay's seven goals for software that keeps your data yours, one by one.→What does "the device is the source of truth" mean?Why local-first apps treat the device copy as primary, and what servers do instead.→Local-first vs cloud-firstWhether the server or the device holds the copy that counts, and what follows.→Can local-first apps still have a backend?What servers are for in a local-first app, and how to keep the app working without them.→
CRDTs and documents
How do CRDTs merge changes without conflicts?The math behind merging in any order, and the two ways CRDTs ship changes.→What kinds of CRDT are there?Counters, registers, sets, maps and sequences, and the merge rule each one uses.→What are Automerge and Yjs?Two open-source CRDT libraries, their data models, and how to choose between them.→What is a replicated document?Shared data that every device holds a full copy of, and how the copies stay in step.→What is a merge function?The rule that combines two copies into one, and the three properties it needs.→
Data on the device
Where does an app's local data live on a phone?App sandboxes, caches, key stores, encryption at rest and backups on Android and iOS.→How do you delete data in a local-first app?Tombstones, history, local storage, backups and erasure requests in local-first apps.→Who can read shared data in a local-first app?Replicas, sync servers, document IDs, group keys and backups as readers of shared data.→How big can a local-first document get?History, tombstones, sync cost and storage limits that set a document's real size.→What is a sync scope (or space)?How apps decide which data each device copies, and why that is not access control.→