SYSTEM DESIGNAUGUST 2026 · 8 MIN READ

Anatomy of an Offline-First Billing Engine: Engineering for Zero Internet Reliance

How we architected a retail point-of-sale system that processes bills at sub-50ms latency with zero network dependency and conflict-free cloud reconciliation.

SB
Sujal Barvaliya
Founder & Lead Engineer
LinkedIn Profile →

The Reality of Indian Retail Infrastructure

In western India, even in tier-1 commercial hubs like Ahmedabad and Surat, retail store networks face intermittent fiber cuts, power switches to generator backups, and congested Wi-Fi networks during holiday rush hours.

If a cloud-only POS application loses connectivity, cashiers cannot print bills, barcode scanners buffer indefinitely, and customer queues spill out onto the street. In retail, downtime directly equals lost revenue and damaged reputation.

The Local-First Architecture Blueprint

We engineered our flagship POS architecture (POSArch) on a local-first paradigm. Each checkout terminal embeds an in-memory SQLite database running locally on the terminal hardware.

Every product lookup, barcode scan, GST calculation, and receipt generation takes place entirely on localhost. Transactions complete in under 20 milliseconds without making a single outbound HTTP request.

“A cashier should never know whether the internet cable is plugged in or unplugged. The billing experience must remain identical.”

Conflict-Free Replicated Data Types (CRDTs) in Action

When connectivity resumes, local transaction logs are cryptographically hashed and synced upstream to central cloud PostgreSQL clusters using deterministic sequence vectors. If two terminals modify inventory concurrently, CRDT commutative merge rules resolve the state automatically with zero data loss.

Topics:#Offline First#SQLite#Distributed Systems#Retail POS#CRDT
FURTHER READING FROM THE BLOGView All Posts →
INITIALIZE ARCHITECTURE DIALOGUE

LET'S BUILD
SOMETHING THAT MATTERS.

Have a business problem, product idea, or system that needs to exist?