Offline-first mobile sync
A mobile app that works on the subway: local store as primary, delta sync with cursors, optimistic UI, and conflicts resolved at the client.
What this design does
The app writes to its local database first — every tap lands in single-digit milliseconds, connectivity optional. A sync engine exchanges deltas with the server using a per-device cursor, so reconnecting after a week costs one incremental pull, not a re-download. When the same row changed in both places, the conflict comes back to the client, where the domain knows how to merge. This is the Linear/Figma-offline school of app architecture.
The patterns it composes
- Offline-first / local-first — the device DB is the primary; the network is an optimization
- Delta sync with cursor — each device pulls only changes since its last-seen version
- Optimistic UI with reconciliation — UI reflects local writes instantly; server echo confirms or repairs
- Client-side conflict resolution — concurrent edits surface to the app, which merges by domain rules
- Idempotent receiver — re-sent deltas after a dropped connection apply exactly once
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.