techdiagrams.net
← All templates

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.

Open in editor — free, no login Download JSON
THE DEVICE — FULLY FUNCTIONAL OFFLINEread/write · ~2mspush outbox deltasapply · version checkCDCchanges since cursorpull deltas → mergewake: new changesMobile appoptimistic UILocal store (SQLite)primary · outbox of pending opsSync APIdelta exchange · cursorizedServer DBauthoritative · version per rowChange feedrow versions in commit orderPush notifiersilent sync nudgeconflict path: both sides edited row 42 →sync returns theirs+ours with versions →the CLIENT merges (domain rules: lateststatus wins, notes concatenate) → push again.

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

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.