Why we tore up our first app and built an offline-first POS instead

Let me tell you a story about a massive failure. When we first started building Dataflee, we did what every modern dev team does: we spun up a cloud database, wrote some API endpoints, and built a slick web-based mobile POS app. It worked beautifully—on our fiber-optic office Wi-Fi. We were convinced we had built the next big thing in retail technology.
Then we took it to a busy retail shop in Kochi to see it in action in the real world. That is when reality hit us like a brick wall.
The 4-second nightmare
It was an absolute disaster. The shop owner was trying to ring up five customers at once. Every time he scanned a barcode, our shiny new cloud-based POS billing app had to do a round-trip to the server. The loading spinner would appear, spin for 3 to 4 seconds, and finally add a single item to the cart.
The line backed up out the door. Customers got annoyed. The shop owner literally handed the device back to us and said, "This is too slow. My paper ledger is faster." It was a humbling moment, but it taught us a crucial lesson about building software for Indian retail.
That was the day we realized that any billing app for a small business absolutely cannot rely on a constant internet connection. 4G drops during peak hours. Thick shop walls block cellular signals. Weather disrupts Wi-Fi. In the real world, the internet is a luxury, not a guarantee. If your internet goes down, your business shouldn't stop.
Pivoting to local SQLite: The Offline-First Approach
We went back to the drawing board and completely inverted the architecture. Instead of the cloud being the source of truth, we made the device the source of truth. We embedded a local SQLite database directly into the Android app.
This fundamental shift meant that the data lived right next to the processor. Now, when a merchant scans a barcode, the retail billing software queries the local chip on the phone. The result is instant. Zero latency. You can ring up 20 items in 5 seconds. The app feels incredibly fast and responsive, whether you have 5G or no signal at all.
Building an offline-first POS system is significantly harder than building a web app. You have to deal with local storage limits, device battery optimization, and complex synchronization logic. But the payoff in performance and reliability is massive. You can learn more about our offline-first POS features here.
What about sync and UPI payments?
Obviously, data still needs to get to the cloud eventually for backups and dashboard analytics. We built a robust background sync queue. When you make a sale offline, it saves locally and goes into a queue. The moment the phone catches a whiff of Wi-Fi or 4G, it silently pushes the data up without interrupting the merchant.
As for payments, you can generate a dynamic UPI QR code on the screen instantly—no internet required on the merchant's side. The customer scans it with their phone (which usually has data), pays, and the merchant hands over the goods. The merchant can manually tap "Paid" and the system reconciles it later. This hybrid approach gives you the speed of local computing with the convenience of digital payments.
Handling Data Conflicts and Edge Cases
One of the biggest challenges with offline-first design is what happens when two devices try to change the same data while disconnected. We implemented a robust conflict resolution system. The system assigns unique timestamps to every action. When devices reconnect, the server acts as the final arbiter, merging changes intelligently. If a product price is updated on device A, and a sale happens on device B with the old price, the system preserves the historical integrity of that specific transaction while updating the master catalog.
The Takeaway
If you're building software for the real world, you have to build it for real-world conditions. An offline-first architecture is a massive pain to engineer (hello, merge conflicts and idempotency), but it's the only way to build a reliable mobile pos app that merchants actually trust when their store is packed.
We didn't just build an app; we built a resilient piece of infrastructure designed to survive the chaos of retail. If you want to experience the speed of true offline billing, download Dataflee POS from the Google Play Store today and see the difference for yourself.
