Decisions6 min read
Offline mode in a POS: what keeps working when the internet drops
By Sannan MalikPublished
Short answerA POS should keep taking orders, sending kitchen tickets, taking cash and printing receipts when the internet drops. That means each till keeps its own local database as its source of truth, saves every sale there first, and syncs to the central server when the connection returns. Anything that depends on a live check, such as loyalty redemption or online orders, should be clearly switched off until the till is back online.
Decide what the till must never stop doing
Offline mode is a business decision before it is a technical one. A restaurant at lunch rush cannot wait for the router. So I start every POS scope with one list: which functions keep working offline, and which ones wait or switch off.
Android's architecture guide gives a useful frame. It describes three ways to write data: online-only writes for things that must happen live, such as a bank transfer; queued writes for things like analytics and logs; and lazy writes, where the app saves locally first and tells the server later. Google calls lazy writes the correct choice when the data is critical. A sale is critical data.
| Till function | With no internet | How I would build it |
|---|---|---|
| Menu, prices, taking an order | Keeps working | Read from the local copy on the device |
| Kitchen tickets | Keeps working if the printer is on the local network | Send over the shop's own network, not through the cloud |
| Cash payment and receipt | Keeps working | Lazy write: saved locally, synced later |
| Card payment | Depends on your terminal and payment provider | Ask the provider in writing; never assume |
| Loyalty points redemption | Switched off | Online-only, so one balance cannot be spent twice |
| Delivery and online orders | Paused | They arrive through the internet by nature |
| Head office reports | Delayed | Fill in once the tills sync |
| Price changes from head office | Wait | Reach the till on its next sync |
Why the local database is the till's source of truth
Android's guide says the local data source is the canonical source of truth in an offline-first app, and the screens should read only from it. Flutter's offline-first guide makes the same point with a repository that gives one access point whatever the connection state. In a POS, that means the till screen never asks the server for the menu. It asks its own database, and a background job keeps that database fresh.
On the device I would use SQLite. The SQLite project states that its transactions are atomic even if writing is interrupted by a program crash, an operating system crash or a power failure. For a till that loses power mid-payment, that is the property you want: the sale is either fully saved or not saved at all, never half.
The same project is honest about the limit. SQLite allows many readers but only one writer at a time, and if many client programs send SQL to the same database over a network, it says to use a client/server engine instead. So I would not make three tills share one SQLite file over Wi-Fi. Each till keeps its own database, and the central server runs PostgreSQL.
Order numbers and sale IDs that never clash
This is where offline POS builds most often go wrong. If the server hands out order numbers, a till with no internet cannot get one. If each till counts from 1, two tills create order 57 on the same afternoon.
I give every sale a UUID created on the device. PostgreSQL's documentation says UUIDs give distributed systems a better uniqueness guarantee than sequence generators, which are only unique within a single database, and that the uuid type stores values generated outside the database. The receipt number the customer sees is separate: a till prefix plus a local counter, such as T2-0457. Short for staff, unique across the shop.
Each sale also carries a synced flag, the pattern Flutter's guide shows, set to false when saved and true once the server confirms it. The sync job only sends rows still marked false, so a retry never creates a duplicate on the server.
Where last write wins is the wrong rule
Android's guide says a common way to resolve conflicts on mobile is last write wins: the server keeps whichever change has the later timestamp. That is fine for a staff member's display name. It is wrong for stock.
A worked example. The kitchen has 3 portions of a dish left. The internet drops. Till 1 sells 2 portions and Till 2 sells 2 portions. If each till sends its new stock total, last write wins records 1 left, which is wrong. If each till sends the change instead, minus 2 and minus 2, the server records minus 1, which is true: you oversold by one. The second answer is the one a manager can act on.
- Sales and payments: append only. They never conflict, because nobody edits a closed sale offline.
- Stock: send movements, not totals, and flag anything that goes below zero for review.
- Prices and menu: the server always wins. A till never edits a price offline.
- Voids and refunds: allowed offline only with a manager PIN, and synced as their own records.
- Table status across tills: I would keep the shop's tills on one local network so they see each other, because the cloud cannot referee while it is unreachable.
What staff should see on screen
Android's guide suggests disabling the parts of the interface that need the internet, or telling the user clearly that they are offline. I would show a small offline banner, the number of sales waiting to sync and the time of the last successful sync. Buttons that are online-only, such as redeeming points, are greyed out with a one-line reason.
One rule I hold firmly: the day cannot be closed while sales are still waiting to sync. Otherwise the Z report and the server disagree, and someone spends the next morning reconciling by hand.
Flutter's guide also warns that background sync running all the time can drain a battery, and suggests checking connectivity first. On a till plugged into the wall that matters less. On a handheld waiter tablet, it matters a lot.
The offline tests I run before opening day
These are run on the real devices and the real printers, in the actual shop if possible.
- Unplug the router halfway through an order, finish it, and print the receipt.
- Pull the till's power during a payment, restart, and check the sale is either complete or absent.
- Run a full mock shift offline, then reconnect and compare the server totals with the till's own totals.
- Sell the same last item on two tills while both are offline, and check it is flagged after sync.
- Change a price at head office while a till is offline, and check the till picks it up on reconnect.
- Install an app update while sales are still waiting to sync, and check none are lost.
- Try to close the day with unsynced sales and confirm the system stops you.
How offline mode fits into the price
A POS is custom software, so I quote it as a fixed price after a written scope rather than as one of my app packages. Offline mode is one of the larger items in that scope, which is why I want the table in the first section filled in and signed off before any build starts. Payment provider fees, hosting and ongoing maintenance are not included.
If you already run a POS, tell me what happened the last time your internet went down: what stopped, and what had to be fixed afterwards. That usually tells me how much of this design your current system has.
Questions
- Can card payments work when the POS is offline?
- That depends on your card terminal and your payment provider, not on the POS software. Ask the provider in writing what their terminal does without a connection. I build the POS so that cash and order taking never depend on the answer.
- Is SQLite good enough for a POS?
- On each till, yes. The SQLite project says its transactions survive crashes and power failures, and it suits a device without expert support. For many tills writing to one shared database over a network, it recommends a client/server engine, so the central store should be something like PostgreSQL.
- How long can a till stay offline?
- With the design above, a till can keep selling for a full shift or longer, because every sale is saved locally first. The practical limits are stale prices, stock that drifts and reports that wait, so I show staff when the last sync happened.
Sources
Platform rules and fees in this article were checked against these official pages on 12 November 2026. They change, so confirm before you rely on them.
Sannan Malik is a software architect and product builder with 8+ years in software, CEO of Alpha Notic FZE and a Certified Scrum Product Owner. He builds mobile apps and business software for companies in the UAE, the wider Gulf, the UK, the US, Canada and Australia.