Skip to main content
Mobile // Offline-first

Assume no signal. Celebrate when there is one.

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.

Build sheet
Storage
SQLite on device
Sync
Operation queue + retries
Conflicts
Rules per entity

Local writes, queued operations, explicit conflict rules, honest sync status.

Conflict rules, decided up front

DataRuleWhy
Delivery statusLatest event winsEvents are ordered by time
Stock countMerge as adjustmentsTwo counts shouldn't overwrite each other
Customer addressServer wins, flag for reviewOffice data is authoritative
Photos & signaturesAlways appendEvidence is never discarded

Every change is an operation

sync/operation.tstypescript
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.

Why offline-first

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.

Core building blocks

ComponentRole
Local databaseStores the data users need on the device (SQLite, Realm, or similar)
Operation queueRecords each change in order, ready to send
Sync engineSends local changes and fetches remote ones when online
Conflict rulesDecide the outcome when changes collide
Status indicatorsShow users what is saved, pending, or in conflict

Design decisions we make with you

What lives on the device

Only the data users need, for privacy, storage, and sync speed.

Conflict policies

Per data type: last write wins, merge, or ask a person.

Sync timing

Immediate when possible, batched to save battery and data.

Device security

Encrypted storage and remote wipe for lost devices.

Delivery plan

  1. Step 01

    Data analysis

    Week 1

    Identify what users need offline and how often it changes.

  2. Step 02

    Sync design

    Week 1–2

    Agree operations, conflict rules, and error handling.

  3. Step 03

    Build

    Week 2–7

    Local storage, queue, sync engine, and UI states.

  4. Step 04

    Chaos testing

    Week 7–8

    Test long offline periods, conflicts, and flaky networks.

  5. Delivered

    Pilot

    Week 8+

    Real users in real conditions, with sync monitoring.

Common pitfalls we help you avoid

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.

What we measure

MeasureWhy it matters
Pending queue sizeHow much work is waiting to sync
Sync success rateChanges that reach the server cleanly
Conflicts by typeWhere rules need refining
Time to syncHow long changes take once online

Who does what

We handle

  • Architecture, sync engine, and app
  • Server-side APIs and conflict handling
  • Testing and monitoring

Your team handles

  • Conflict policies and business rules
  • Pilot users in real conditions
  • Device management policy

A worked example

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.

What success looks like

Success is an app nobody thinks about connectivity while using, with every change eventually reaching the server and conflicts handled by rules everyone understands.

Conflict strategies

StrategyHow it worksGood for
Last write winsThe latest change replaces earlier onesSimple fields like notes or status
Merge operationsChanges are combined, such as adding quantitiesCounters and quantities
Server authorityThe server decides, and the device updatesPrices and rules owned centrally
Manual resolutionA person reviews both versionsHigh-value or ambiguous changes

Myths we hear

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.

Before you start

  • Where users lose signal today
  • Which data changes often, and who changes it
  • How long devices may stay offline

Questions to ask any provider

  • What happens when two people edit the same record?
  • How do users know their work is saved?
  • How long can devices stay offline safely?

Keeping it maintainable

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.

The principles and platform facts

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.

Frequently asked questions

How much data can be stored offline?
Plenty for most field tasks. We sync only what each user needs, like today's routes or assigned jobs.
What happens if sync fails repeatedly?
Operations retry with backoff, then surface as failed with a clear action for the user or support.
Is offline data secure?
Local databases are encrypted and cleared on logout or remote wipe.
Can web apps work offline too?
Yes, as progressive web apps with service workers and local storage, within browser limits.
Is this only for mobile?
The same patterns apply to any client that can lose connectivity.
Is offline-first harder to build?
Yes, somewhat. The extra effort is in sync and conflict handling, which is why we design those carefully up front.
Can existing apps be made offline-first?
Often, by adding local storage and an operation queue, though it may require reworking how data is loaded and saved.
How much data can be stored on the device?
Typically far more than business apps need. We store only what users require, which also limits exposure if a device is lost.
Does offline-first work for web apps?
Yes, as progressive web apps using service workers and browser storage, within platform limits.
What if a device is offline for weeks?
Changes stay queued safely. On reconnect they sync in order, and conflicts follow the agreed rules.
Which technologies do you use for offline storage?
Commonly SQLite-based databases on mobile and IndexedDB in browsers, chosen to fit the app framework.
Can the server push changes to devices?
Yes. Devices fetch changes on reconnect, and notifications can prompt a sync when something important changes.
Is offline data encrypted?
Yes. Local data is encrypted, and access is protected by the device lock and app login.
Can offline-first apps handle large catalogs?
Yes, by syncing only the subset users need and updating it incrementally.
Do you monitor sync in production?
Yes. Queue sizes, failures, and conflicts are tracked so issues are spotted early.
Can users see conflicts?
Yes. Conflicts needing a decision appear in a clear list with both versions side by side.
Can a web app be offline-first?
Yes, with local storage and a service worker, but not relying solely on the Background Sync API, which some browsers lackSource [3].
Will queued work survive the app being closed?
On Android, WorkManager persists it across restarts and rebootsSource [2]. We use the equivalent mechanisms on each platform.