How OilShop.pk Scaled to 500 Shops Without Downtime
The architecture and engineering decisions behind OilShop.pk: offline-first POS, multi-tenancy, queues and zero-downtime deploys at 99.9% uptime.
When we launched OilShop.pk in 2019, it ran on a single server and served a handful of shops in Lahore. Today it supports 500+ shops across Pakistan with over a million service records. Here's what we learned along the way.
Decision 1: Assume the internet will fail
Load-shedding and patchy connections are normal for shops in Pakistan. A cloud-only POS that stops billing when the internet drops is unusable.
So the POS writes every sale locally first, then syncs to the cloud in the background. Each record carries a client-generated ID and timestamp, so the server can safely de-duplicate and merge. Shops have kept billing through outages lasting hours without losing a single invoice.
Decision 2: Multi-tenancy that's cheap and safe
Running a separate database per shop would have been simple but expensive. Instead, every table is scoped by tenant, enforced in a global query scope in Laravel and verified by automated tests that try to read across tenants. One database, strict isolation.
Decision 3: Move slow work off the request
Sending WhatsApp invoices, generating reports and calculating service reminders all happen in Redis-backed queue workers. The checkout request stays fast regardless of what else is going on, and workers scale independently at month-end.
Decision 4: Read replicas for reporting
Owners love reports — and reports are heavy queries. Routing analytics to a read replica means a shop owner running a yearly profit report never slows down another shop's checkout.
Decision 5: Deploy without anyone noticing
We use blue-green deployments behind a load balancer: the new version boots alongside the old, health checks pass, traffic switches over. Database migrations are written to be backward-compatible so both versions can run at once. Result: no maintenance windows, ever.
The numbers today
- 500+ registered shops
- 1M+ service records
- PKR 100M+ processed through the platform
- 99.9% uptime
What we'd tell other SaaS founders in Pakistan
Design for local reality first — connectivity, devices, payment habits and WhatsApp. The technology choices that look boring (Laravel, MySQL, Redis) are the ones that let a small team run a large platform reliably.