What lives on the device
Only the data users need, for privacy, storage, and sync speed.
Offline-first apps write locally first and sync when they can. The hard part isn't storage; it's deciding what happens when the network returns with conflicting changes.
Local writes, queued operations, explicit conflict rules, honest sync status.
| Data | Rule | Why |
|---|---|---|
| Delivery status | Latest event wins | Events are ordered by time |
| Stock count | Merge as adjustments | Two counts shouldn't overwrite each other |
| Customer address | Server wins, flag for review | Office data is authoritative |
| Photos & signatures | Always append | Evidence is never discarded |
type SyncOperation = {
id: string; // client-generated UUID, used for idempotency
entity: "delivery" | "count" | "photo";
action: "create" | "update";
payload: unknown;
createdAt: string;
attempts: number;
status: "pending" | "sent" | "failed";
};Show users the truth
Pending, saved, and failed states should be visible. A driver who knows a signature hasn't synced yet can stay in coverage for a minute; one who doesn't loses the proof.
Most apps are built assuming a connection, then patched to handle failures. Offline-first apps assume the opposite: the device is the primary place where data is read and written, and the server is synchronized whenever a connection exists. Users never wait on the network to do their work.
This matters wherever signal is unreliable: warehouses, basements, rural routes, airplanes, and large buildings. It also makes apps feel faster everywhere, because every action completes locally first.
The difficult part is synchronization. When two people change the same data, or a device has been offline for days, the system needs clear rules for what happens. We design those rules with the business before writing code.
| Component | Role |
|---|---|
| Local database | Stores the data users need on the device (SQLite, Realm, or similar) |
| Operation queue | Records each change in order, ready to send |
| Sync engine | Sends local changes and fetches remote ones when online |
| Conflict rules | Decide the outcome when changes collide |
| Status indicators | Show users what is saved, pending, or in conflict |
Only the data users need, for privacy, storage, and sync speed.
Per data type: last write wins, merge, or ask a person.
Immediate when possible, batched to save battery and data.
Encrypted storage and remote wipe for lost devices.
Step 01
Identify what users need offline and how often it changes.
Step 02
Agree operations, conflict rules, and error handling.
Step 03
Local storage, queue, sync engine, and UI states.
Step 04
Test long offline periods, conflicts, and flaky networks.
Delivered
Real users in real conditions, with sync monitoring.
The first pitfall is syncing whole records instead of operations. Sending “set quantity to 5” loses information when two people adjust stock; sending “add 2” lets both changes apply.
The second is hiding sync state. Users who can't tell whether their work is saved will redo it or lose trust, so every screen shows what is pending.
The third is testing only online. We test with networks switched off for hours, flaky connections, and two devices editing the same data.
| Measure | Why it matters |
|---|---|
| Pending queue size | How much work is waiting to sync |
| Sync success rate | Changes that reach the server cleanly |
| Conflicts by type | Where rules need refining |
| Time to sync | How long changes take once online |
Imagine stock counters in a large warehouse where signal drops between aisles. Each counter records counts offline as operations; when the device reconnects, the counts sync to the ERP.
If two counters count the same location, the rule agreed with the warehouse manager flags it for recount instead of silently picking one, and the dashboard shows exactly which locations need attention.
Success is an app nobody thinks about connectivity while using, with every change eventually reaching the server and conflicts handled by rules everyone understands.
| Strategy | How it works | Good for |
|---|---|---|
| Last write wins | The latest change replaces earlier ones | Simple fields like notes or status |
| Merge operations | Changes are combined, such as adding quantities | Counters and quantities |
| Server authority | The server decides, and the device updates | Prices and rules owned centrally |
| Manual resolution | A person reviews both versions | High-value or ambiguous changes |
Myth: Offline-first is only for remote areas.
Reality: It also makes apps faster and more reliable in cities and offices, where signal still drops.
Myth: Sync just means uploading data later.
Reality: Real sync handles ordering, retries, conflicts, and partial failures, which is where most of the work lies.
Myth: Users won't notice sync issues.
Reality: They notice lost work immediately. Clear status indicators prevent confusion.
The sync engine is isolated from the screens and covered by tests that simulate long offline periods and conflicting edits, so new features can be added without breaking how data moves.
Ink & Switch's essay on local-first software lists ideals including no spinners and an optional network, and points out that when the server holds the primary copy, changes and many look-ups need a round tripSource [1]. Offline-first apps reverse that: work is saved locally, then synchronized.
Platforms differ in how reliably they run background sync. Android's WorkManager persists scheduled work across app restarts and reboots and supports exponential backoffSource [2]. On the web, MDN marks the Background Synchronization API as limited availability because it doesn't work in some widely used browsersSource [3], so web apps also retry whenever the page is open.
Offline-first sync
A design checklist for local writes, queued operations, conflict resolution, retries, and user feedback in offline-capable apps.
WebProgressive web apps
Progressive web apps with offline support, background sync, push notifications, and installability, without app store overhead.
MobileOdoo mobile apps
Custom mobile apps for Odoo: barcode warehouse scanning, delivery and proof of delivery, field service, and offline sync.
Next step
Thirty minutes with an engineer, no slide deck required. You'll leave with a clearer picture, whether or not we work together.