Local-first software: building apps that work without a signal
For a sales rep in a market lane or a driver on a rural road, offline is not an edge case. It is Tuesday.

Most apps assume the network is there. Every tap sends a request, waits, and shows a spinner. In an office on fibre that works fine. For field staff it does not. In a shop with one bar of signal, a spinner means the sales rep gives up and writes the order on paper.
Local-first software flips the assumption.
What local-first means
In a local-first app, the device has its own database. Every read and write goes there first, so screens load instantly and actions complete immediately. A background process syncs changes with the server when a connection is available, and pulls down changes made by others.
The server is still the shared source of truth, but the user never waits for it.
The building blocks
When we build offline-first field apps, such as our Dukaro distribution app, the core pieces are:
- A local database on the device, such as SQLite.
- IDs generated on the device, usually UUIDs, so a new shop created offline can immediately have orders attached to it.
- An ordered outbox of changes waiting to be sent.
- Idempotent sync on the server. Each change carries its own id. The server records which ids it has applied, so if the phone retries after a timeout, it gets the stored result rather than a duplicate order.
- Delta pulls, where the phone asks for everything changed since its last sync cursor.
Conflicts are a product decision
Two people edit the same record while offline. Who wins? "Last write wins" is simple and often wrong. Better to decide per field:
- Quantities and money usually go through the server, which validates them against stock and credit limits and can reject with a clear message.
- Notes and descriptions can merge or keep both versions.
- Status changes follow a state machine, so an order cannot go from delivered back to pending.
Business rejections, such as "credit limit exceeded", should be final and shown to the user. Network and server errors should be retried quietly.
CRDTs and sync engines
For collaborative editing, such as documents or whiteboards, conflict-free replicated data types (CRDTs) can merge concurrent changes automatically. A growing number of sync engines and libraries now package this up. For transactional business apps with stock and money, an explicit outbox with server validation is usually easier to reason about.
Test the bad network
Most offline bugs only appear on a bad connection. Test with network throttling, airplane mode in the middle of a save, killing the app mid-sync and two devices editing the same record. If it survives that, it will survive the field.
Frequently asked questions
What is a local-first app?
An app that stores and edits data on the device first, so it works instantly and offline, and syncs changes with a server in the background when a connection is available.
How do you avoid duplicate records when syncing?
Give every change a unique id generated on the device and make the server idempotent: it records which change ids it has applied and returns the stored result on a retry instead of applying it again.
What database do offline mobile apps use?
SQLite is the most common choice on Android and iOS, often wrapped by a library or ORM in Flutter or React Native.
Keep exploring
Enjoyed this? Get the next one first.
One email a month with our newest articles on AI, engineering, mobile, ERP and the products we ship. No spam, unsubscribe any time.
- Monthly, never more
- New case studies first
- Practical, no hype


