Most software is designed on a fast laptop over a fibre connection, and then tested on the same laptop. The people we build for work somewhere else. A cooperative officer registers producers at a collection point on the edge of coverage. A cashier sells from a low cost Android phone that also runs the shop’s WhatsApp. A shop loses power in the middle of the afternoon and the till has to come back exactly where it was.
We could treat those conditions as problems to work around. We treat them as the brief. Every product in the SHAM Digital family starts from three assumptions: the network will drop, the device will be modest, and the user’s time at the counter or in the field is worth more than ours at the desk. Here is what that means in practice, drawn from the requirements we have written for SHAM and Mauzo.
Write the device into the requirements
A constraint only shapes a product if it is written down where an engineer cannot ignore it. So our requirements name the device, not the ambition.
The SHAM platform requirements set the field client against Android Go class hardware: 1 GB of memory, Android 8, an install under 25 MB and a cold start under four seconds. The Mauzo requirements set the till against a low cost Android device typical of a Tanzanian shop, and define success as a full sale completing on a phone with 2 GB of memory and Android 9.
Those numbers rule out a heavy framework that only feels fast on a flagship phone, and they turn performance into an acceptance test instead of a polish task. The Mauzo requirements list a low end device that cannot hold a 5,000 line catalogue and a long offline queue as a risk, and the answer is to test on the target device from the first sprint.
Our requirements name the device, not the ambition.
Offline is the default, not the fallback
The SHAM requirements state it as a principle: every write path must complete without a network and reconcile later, and a feature that needs a connection at the moment of capture is not shippable. Mauzo applies the same rule at the till. Selling, refunds, stock movements and closing a shift all work offline, and everything queues for synchronisation.
In practice every device keeps its own full local database. A write goes to the local store first, with a record of the change in an outbox beside it. The user gets an answer from the phone in their hand, not from a server in another city. The SHAM requirements ask for every capture action to respond in under 300 milliseconds on the target hardware, which is only possible when nothing in that path waits for the network.
We also write down how long a device must cope alone. A SHAM field device must lose nothing across a 14 day offline period. A Mauzo till must trade for at least 72 hours offline without degrading, and a full day of server outage must not stop a single till. Server uptime still matters, but it no longer decides whether a shop can sell.
Sync later, and never twice
Working offline is the easy half. The hard half is what happens when a device reconnects with three days of records and the server has moved on without it.
The Mauzo system design answers that with a few rules that remove whole classes of conflict:
- Every record gets its identifier on the device, so nothing waits for a server to name it.
- Changes are pushed in batches and each operation carries its own id, so a record delivered twice still produces one row.
- Sales, payments and stock movements are append only. Nobody overwrites them, so two devices cannot disagree about them.
- Stock is the sum of its movements, not a number each device edits, so an offline till cannot overwrite another till’s count.
The SHAM requirements go further for money: last write wins is prohibited for financial events, and a correction is a reversing entry, never an edit. We chose that to make sync safe. It also gives an auditor or a lender what they need: a history that is never rewritten.
Working offline is the easy half. The hard half is what happens when a device reconnects.
Show the queue
An offline system that hides its state is one people stop trusting. If a cashier cannot tell whether yesterday’s sales reached the owner, they go back to the notebook, and the product has failed.
So the queue is visible. The Mauzo requirements ask every till to show when it last synchronised and how many records are waiting, and to warn when the queue grows too old. The Android till now in field testing does this in plain words. When the signal drops, the status line reads “Offline · selling works”. The sync screen shows how many changes are awaiting upload and when the till last synced. Closing a shift checks that every sale has been sent.
While the app is open the till tries to sync every 30 seconds. When it cannot, it keeps selling and says so.
Spend the user’s data like money
On a metered bundle, every megabyte comes out of the user’s pocket. The SHAM requirements make sync incremental and resumable, with a target that a full day of field capture syncs in under 2 MB. The Mauzo requirements ask the app to report its own data use, so that a month of trading at a duka costs a stated and tested amount. Images are the usual culprit, so the till fetches product pictures in two small sizes and keeps them on the device instead of downloading them again.
Power gets the same treatment. The Mauzo requirements ask the app to survive abrupt power loss at any point without corrupting its local store, and test it by killing the app at a hundred random points.
Reach people who do not have the app
Not everyone in a value chain owns a smartphone, and not everyone wants another app. So the products meet people on the channels they already use.
The SHAM requirements pair the Android client with a USSD and SMS route, so a producer without a smartphone can be registered and can check their own record from any GSM handset, and an SMS confirms a registration once it syncs. SihaPlus is designed to be reachable in the app, on WhatsApp and over USSD. Fyundi reaches technicians through the app, WhatsApp and assisted workflows. Mauzo can send a receipt by SMS or WhatsApp, and when there is no connection the message waits in the queue instead of claiming it was sent.
Language belongs in the same list. Swahili is the primary language of the SHAM producer product, and Kiswahili is the default at the Mauzo till, with the requirement that no screen falls back to English.
What it costs
None of this is free. Offline first means two databases to keep honest instead of one, and a sync protocol that has to be specified, versioned and tested on both ends. The Mauzo design keeps that contract in a single OpenAPI specification so the Android, desktop and web clients stay compatible with each other.
It also means accepting that some things cannot happen offline. A mobile money push needs a network, so when there is none the till asks for the M-Pesa transaction code and marks the payment as one to verify. A fiscal receipt number cannot always be allocated at the counter, an open question the Mauzo requirements put to the revenue authority before any fiscal code is written.
The constraint turns out to be the brief. A product that works on a 1 GB phone, with no signal, on a metered bundle and in Swahili, works almost anywhere else too. The reverse is rarely true.