Learning Center
Offline-first and sync
An offline-first app reads and writes on the device and syncs when a connection returns. Learn how offline sync, conflict resolution, consistency models and sync engines work.
Basics
How do apps work without internet?Local data, queued writes, sync on reconnect, and talking to nearby devices directly.→Offline-first vs local-firstTwo approaches to working offline, and where each keeps the source of truth.→How do you design an offline-first architecture?Local store first, a write strategy per action, a sync layer, and a clear authority.→Offline vs partitioned: what is the difference?No connection at all, or a network split into groups. Why apps should treat them apart.→What happens to a write made offline?The path of an offline change, from the local database to accepted or rejected.→
Sync
How does offline sync work?How copies edited apart exchange changes and end up the same.→How are sync conflicts resolved?Last writer wins, keeping both, automatic merges, and when an authority must decide.→What is delta sync?Send only what changed since the last sync, and know where you left off.→What is a sync engine?The layer that keeps a local copy and its server or peers in step.→Peer-to-peer sync vs cloud syncSyncing through a server versus directly between devices, and when to use both.→
Consistency
What is an optimistic update?Show the change now, confirm it later, and know how to undo it.→What is eventual consistency?Copies that may disagree for a while, but agree once updates stop arriving.→What is last writer wins?Keep the newest write, drop the rest, and know what that costs.→What is a vector clock?One counter per participant, so concurrent changes can be told apart.→What is a Lamport timestamp?A counter that orders events across devices without trusting their clocks.→Operational transformation vs CRDTsTwo ways to merge edits to shared documents, and where each one fits.→What is the CAP theorem?Consistency, availability and partitions, and what the trade-off means offline.→