June 22, 2022
Building an Offline-First POS System
Internet in Kenya is better than it used to be. But "better" doesn't mean reliable.
Power cuts. Network outages. Rural shops with spotty coverage. If your POS requires constant connectivity, you're dead in the water half the time.
The Architecture
We built the POS with React and a local IndexedDB for offline storage. Every transaction writes locally first, then syncs to the backend when connectivity returns.
The tricky part isn't storing data offline. It's handling conflicts when multiple devices sync different versions of truth.
Conflict Resolution
We use timestamp-based merging with a server-authoritative model. The backend maintains the canonical state, but clients can operate independently and reconcile later.
Not perfect, but good enough for 99% of cases.
Lessons Learned
- Test on actual 2G networks, not throttled WiFi
- Users will unplug things. Plan for it.
- Auto-sync is great until it kills someone's data bundle
Building for Africa means building for reality, not ideal conditions.