Should Your App Work Offline? Offline-First Planning and Development Guide
Offline mobile app development, job by job: which tasks need offline support, what drives the effort, and how local data, sync queues and conflicts fit.
Should your app work offline?
Your app should work offline for the specific jobs where users regularly lose signal and where waiting or losing entered data would stop their work. For everything else, good caching and clear error messages are usually enough. Offline support is a per-job product decision, not an all-or-nothing architecture choice. A field inspection form may need full offline writing; the same app's payment screen should stay online-only.
Android's architecture guidance defines an offline-first app as one that can perform "all, or a critical subset of its core functionality without access to the internet". The phrase "a critical subset" is the useful part: decide which subset, then build only that.
Offline-first development makes the device's local database the app's primary data source: the UI reads and writes locally, a sync queue sends changes to the server when connected, and the app pulls server updates and resolves conflicts. That is worth the added complexity for field service, logistics, healthcare visits and construction. Many other apps only need offline-capable caching.
Key takeaways
- Decide offline support job by job, not for the whole app.
- Use Android's three write strategies as a shared vocabulary: online-only, queued and lazy.
- Never commit money, bookings or stock offline; show a clear pending state instead.
- The biggest effort drivers are shared records, attachments, long offline periods and the testing matrix.
- Managed sync services can be withdrawn; keep your sync layer replaceable.
Offline-first vs offline-capable
Most apps benefit from some caching so screens load quickly and show something when the connection drops; the mobile app architecture guide covers that baseline. Offline-first goes further: creating, editing and completing core tasks all work without a connection, and synchronisation becomes a first-class part of the design.
| Offline-capable | Offline-first | |
|---|---|---|
| Primary data source for UI | Network, with cache fallback | Local database |
| Reading offline | Recently viewed content | All data needed for the workflow |
| Writing offline | Blocked or limited | Fully supported, synced later |
| Sync complexity | Low | High: queues, conflicts, retries |
| Typical apps | Content, commerce, social | Field work, logistics, inspections, travel |
The job-by-job offline worksheet
List every job a user does in the app, then fill one row per job. The write strategies come from Android's official guidance, and they apply equally to iOS and cross-platform apps:
- Online-only write: write to the server first and only update the device after it succeeds. Android's example is a bank transfer. Offline, the app disables the action or explains that a connection is needed.
- Queued write: put the write in a queue and send it later with exponential backoff. Suited to non-critical data, such as analytics events, where the user does not need to know if it failed.
- Lazy write: save locally first, then queue it for the server. Android calls this "the correct choice when the data is critical to the app", such as a task or form a user must not lose. It needs conflict handling.
Worksheet columns and how to score them
Use these columns. The last one is the verdict that goes into your scope.
| Column | What to record |
|---|---|
| Job | One user task, such as "complete an inspection" or "check stock level" |
| Where it happens | The real connectivity: office Wi-Fi, vehicles, basements, rural sites, flights |
| Offline need | None / read only / read and write |
| Freshness tolerance | How old can the data be before it causes harm: seconds, minutes, hours or days |
| Conflict risk | Single-owner record / shared record / scarce resource (money, stock, a time slot) |
| Write strategy | Online-only / queued / lazy |
| Verdict | Online-only with good errors / cached read / full offline-first |
Hypothetical example: a property inspection app
This example is hypothetical. A company sends inspectors to buildings with poor signal in plant rooms and basements. Its worksheet looks like this:
| Job | Where | Offline need | Freshness | Conflict risk | Write strategy | Verdict |
|---|---|---|---|---|---|---|
| View today's assigned jobs | Office, then on site | Read | Hours | Single owner | None | Cached read, refreshed each morning |
| Complete inspection checklist | Basements, plant rooms | Read and write | Hours | Single owner | Lazy | Full offline-first |
| Attach photos | On site | Write | Hours | Single owner | Lazy, uploaded on Wi-Fi | Full offline-first with an upload queue |
| Edit shared site notes | On site | Read and write | Minutes | Shared record | Lazy with merge rules | Offline-first, field-level merge |
| Book a follow-up visit slot | Anywhere | None | Seconds | Scarce resource | Online-only | Online-only with a clear message |
| Usage analytics | Anywhere | Write | Days | None | Queued | Queued, silently retried |
The "never offline-commit" rule
Jobs that move money or claim something scarce should never be confirmed on the device alone: taking a payment, booking an appointment slot, reserving a seat, or decrementing stock. Two offline devices can both believe they got the last unit. Use Android's online-only strategy for these, or let the app save the request as pending and have the server accept or reject it when the connection returns. The interface must make the pending state obvious and must not show a success message until the server confirms.
Pro tip
If a job's conflict risk is "scarce resource", its write strategy should be online-only or server-reconciled with a visible pending state. If it is "single owner" and the work is valuable, lazy writes are usually right.
What drives the extra effort
There is no fixed price for "adding offline". These are the factors that make it more or less work, so you can compare estimates on the same basis. Put the relevant ones in the brief for any mobile app build you are scoping. For overall budgeting, see mobile app development cost.
| Cost driver | Lower effort | Higher effort |
|---|---|---|
| Offline-write entities | One or two record types | Many related record types |
| Shared records | Each record has one owner | Several people edit the same record |
| Attachments and media | None, or small images | Many photos, video or large files |
| Data volume per user | A small assigned set | Large catalogues or history on the device |
| Time spent offline | Minutes to hours (pull-based sync can cope) | Days (push-based replica needed) |
| Authentication offline | Short sessions, always online at start | Tokens that expire while users are offline |
| Schema changes | Rare | Frequent, requiring on-device migrations |
| Testing matrix | One platform, simple flows | Several platforms, conflicts, long offline periods |
| Sync technology | Your own simple API | A managed sync service you depend on |
Pull-based or push-based sync
Android's guidance describes two sync models. Pull-based sync fetches data when the app needs it, often just before a screen is shown. It "works best when the app expects brief to intermediate periods of no network connectivity" and is simpler to build, but long outages leave users facing empty or stale screens. Push-based sync keeps a local replica of the data the user needs and relies on the server to signal changes, so the app can work offline for extended periods; it needs data versioning and a server that supports sync. Many apps use both: pull for fast-changing feeds, push for the records a user is responsible for.
The architecture
The UI reads from and writes to a local database. Writes are also recorded in a sync queue. A sync engine sends queued changes to the API when connectivity allows, pulls changes made elsewhere, resolves conflicts and updates the local database, which updates the UI. Android's guidance makes the local data source "the canonical source of truth", with the UI never talking to the network layer directly.
Local storage and databases
SQLite underpins most mobile offline storage, through Room on Android, Core Data or SwiftData on iOS, and libraries for React Native and Flutter. Room "provides an abstraction layer over SQLite". SwiftData can optionally sync across one person's devices through iCloud, which is not the same as a multi-user business backend. Managed options such as Cloud Firestore include offline persistence, enabled by default on Android and Apple platforms, with offline writes syncing on reconnect.
Model the local schema around what users need offline, not a full copy of the server. Decide how much data to download: everything a user is assigned, or a recent window.
Worth noting
Sync-vendor risk: MongoDB deprecated its Atlas Device SDKs and Atlas Device Sync in September 2024, and they reached end of life and were removed on 30 September 2025. Apps built on Device Sync had to move to another solution or remove sync. The on-device Realm database continues as an open source project, with community branches that remove the sync code. The lesson is not to avoid managed sync, but to keep your sync layer behind your own interface, own your server-side data model, and know how you would migrate if a vendor withdrew the service.
Caching
Even offline-first apps cache differently by data type. Reference data (product catalogues, forms) can refresh periodically; user-generated records sync continuously; large media may download on demand. Define freshness rules for each, using the freshness column from your worksheet.
Synchronisation
Sync usually combines pushing local changes and pulling server changes since the last sync, using timestamps, version numbers or change tokens. Run sync when connectivity returns and on a schedule, using platform facilities for deferred work such as WorkManager on Android and background tasks on iOS, which the OS may delay. On Android, the queue can be a Room table drained by WorkManager.
Queueing changes and retries
Record each change as an operation in a durable queue that survives app restarts. Send operations in order where order matters, retry with exponential backoff, and make server endpoints idempotent so a retried operation isn't applied twice. Give each operation a client-generated ID for this purpose.
Conflict resolution
Android notes that for mobile apps "a common approach is 'last write wins'", using timestamps. It is simple, but it silently discards the earlier edit, so choose per data type:
| Strategy | How it works | Suits |
|---|---|---|
| Server wins | Server version replaces local change | Reference data, admin-controlled records |
| Last write wins | Most recent change kept | Low-stakes personal data |
| Field-level merge | Non-overlapping field changes combined | Records edited by several people |
| User decides | Conflict shown for manual resolution | High-value records where silent loss is unacceptable |
| Domain rules | Business logic decides | Inventory, bookings, financial data |
Optimistic updates and data consistency
Show changes immediately and mark them as pending until synced. If the server rejects a change, for example because stock ran out, explain it clearly and offer a fix. Keep validation rules consistent between app and server so offline edits don't fail later for avoidable reasons.
Connectivity detection
Platform network APIs tell you whether a network is available, not whether your server is reachable. Treat actual request success as the real signal, and don't block the UI on connectivity checks in an offline-first app. On iOS, `NWPathMonitor` reports network changes, and the path's `isExpensive` (cellular or Personal Hotspot) and `isConstrained` (Low Data Mode) properties let you postpone large syncs such as photo uploads.
Security of local data
Offline apps store more data on the device, so minimise what's downloaded, encrypt sensitive databases and files with platform facilities, clear data on logout, and consider remote wipe for managed devices. See mobile app security.
UX for offline states
Show connection status unobtrusively, mark items waiting to sync, show when data was last updated, and never let users lose entered work. Explain clearly when an action genuinely needs a connection. See mobile app UX design for designing these states.
Testing offline scenarios
- Airplane mode during creation and editing
- Slow and flaky networks, not just fully offline
- App killed and restarted with a non-empty sync queue
- Long offline periods followed by large syncs
- Conflicting edits from two devices
- Server rejection of queued changes
- Logout with unsynced changes
- Expired login while offline
When offline-first is the wrong choice
Field service and maintenance, inspections and audits, delivery and logistics, sales teams visiting customers, healthcare visits, and travel apps are typical candidates. These are illustrative patterns; the deciding factor is always how users work and what failure costs them.
It is usually the wrong choice when users are on stable connections, when the core jobs depend on live data (live prices, availability, payments), when data must never be stored on a device for regulatory or security reasons, or when the team cannot yet support sync and migrations properly. In those cases, a well-cached online app with honest error states is cheaper and more reliable. Common mistakes include building full offline sync for every screen, letting users "complete" payments or bookings offline, and choosing a managed sync service without an exit plan.
Sources
Android: Build an offline-first app; Save data in a local database using Room. Apple: SwiftData; NWPathMonitor; NWPath. SQLite: Appropriate uses for SQLite.
Vendor documentation: Firebase: access data offline; MongoDB: Atlas Device SDKs deprecation.
Accessed 15 October 2026. Platform APIs and vendor services change; check current documentation before choosing a sync approach.
Conclusion
Offline-first is a deliberate architecture: local data as the source of truth, a durable sync queue, clear conflict rules, secure local storage and honest offline UX. Decide it job by job. Next steps: fill in the worksheet for every user job, mark the scarce-resource jobs as online-only, check which cost drivers apply, and only then ask for estimates. For the wider build context, see the mobile app development guide, and for keeping sync from draining battery and data, mobile app performance optimisation. For maps and location features in field apps, see GIS application development.
Scoping an app for field teams?
ZSpace Labs is a remote-first technology studio that works with clients globally on mobile app development. If useful, we can map which of your users' jobs need offline support and what that adds to the build before you commit.
Common questions.
An app designed so the local database on the device is the primary source for the UI. Users can read and change data without a connection, and changes sync with the server when connectivity returns.
Offline-capable apps cache some content to show when the connection drops. Offline-first apps are built so core workflows, including creating and editing data, work fully offline and sync later.
When users work in places with unreliable connectivity, such as field service, logistics, healthcare visits, travel, or construction sites, and losing work or waiting would be costly.
Commonly SQLite and libraries built on it, such as Room on Android, Core Data or SwiftData on iOS, and cross-platform options for React Native and Flutter. Some managed backends include offline support: Cloud Firestore, for example, enables offline persistence by default on Android and Apple platforms. Realm's on-device database continues as an open source project, but MongoDB's Atlas Device Sync reached end of life on 30 September 2025, so Realm no longer comes with a managed sync service from MongoDB.
Common strategies include server-wins, last-write-wins, field-level merging, and asking the user. The right choice depends on the data; financial records and shared documents need different rules.
Showing a change in the UI immediately as if it succeeded, while the sync happens in the background, and rolling back or flagging it if the server rejects it.
It's as secure as you make it. Sensitive offline data should be minimised, encrypted using platform facilities, and cleared on logout.
Use airplane mode and network conditioning to simulate no connection, slow connections and flaky networks, and test sync after long offline periods and with conflicting edits.
Yes, typically. Sync, conflict handling and testing add real work, which is why it should be reserved for apps where offline use genuinely matters.
They should not be committed offline. Anything that moves money or claims a scarce resource, such as a stock unit or an appointment slot, needs the server to confirm it. The app can save the request, show it clearly as pending, and submit it when the connection returns, but the user should not be told it succeeded until the server says so.
Rarely. Most apps have a few jobs that must work without signal and many that can simply show a clear error or cached data. Deciding job by job usually cuts the scope, and the cost, considerably.