
A lot of my work is for clients who don't have a Silicon Valley budget: a farm in South Punjab, a small retail shop, a clinic, a startup paying from savings. For them, a system that costs $300 a month to run is not "cheap infrastructure". It's a reason not to use software at all.
So I've had to get good at building systems that are smart and still cost close to nothing to run. Here's what that looks like in practice.
1. The cheapest server is the one you don't need
Before choosing a hosting plan, I ask whether the product needs a server at all.
Kisaan Hisaab, the farm ledger app I built for my family's cotton farm, has no backend. Every record lives on the phone. PDFs are generated on the device. Backups are a JSON file sent through the phone's share sheet, usually to WhatsApp or Drive. Running cost: zero. And it works in a field with no signal, which a cloud app wouldn't.
SalezFlow POS runs on the shop's own PC with a SQLite database. The only cloud part is a small licensing and support panel. The shop's business data never leaves its computer, so the server costs stay tiny no matter how many sales the shops make.
Offline-first isn't always the answer. But when the user's own device is powerful enough, using it is the biggest cost cut available.
2. One well-structured app beats five services
For most small and medium products I use a single Next.js app with MongoDB: public pages, admin, API routes, all in one deploy. One codebase, one pipeline, one bill.
That doesn't mean messy. Inside the app I keep clear modules (billing, auth, content, reports), each with its own data access. When something needs to be split out later, the boundary is already there. Until then, I don't pay for the network calls, the extra hosting and the extra on-call that separate services bring.
3. Free tiers, used deliberately
My own portfolio and my agency site run on free or near-free tiers: Vercel for hosting, MongoDB Atlas for the database, Cloudinary for images, and a free Redis tier for rate limiting. That's not an accident. Some choices that keep them inside those limits:
- Static and cached pages. Public pages are rendered once and refreshed every hour (or immediately when content changes), instead of hitting the database on every visit.
- Images processed at upload. Cropping and resizing happen once, so pages never serve a 6 MB original.
- A fallback when the database is down. The site falls back to built-in content, so a free-tier hiccup doesn't become an outage.
The trick is knowing exactly which limit you'll hit first, and designing so you hit it late.
4. Pay for storage in the right place
Files are usually the first thing that gets expensive. For StaffVertex, screenshots go straight from the desktop app to Cloudflare R2 through presigned URLs. The image bytes never pass through our application server, and R2 doesn't charge for egress. That one decision saves both bandwidth and server time on every single screenshot.
On smaller projects I clean up after myself. When an image is removed in the admin, it's also deleted from Cloudinary, so storage doesn't silently fill up with orphans.
5. "Smart" doesn't have to mean expensive AI calls
Clients often ask for something "smart". Very often that means good defaults and good rules, not a model:
- Kisaan Hisaab shows a reminder banner if today's work hasn't been logged by evening. No AI, no push server. Just a check when the app opens.
- Kisaan Hisaab suggests the quantities a farmer usually enters. The POS has quick-cash buttons and plays a different sound for an unknown barcode.
- Stock levels become "low" or "critical" based on thresholds the pharmacy sets.
When AI genuinely adds value, I use it carefully: call a model only when needed, keep prompts short, cache results that don't change, and meter usage per feature so we can see what each feature actually costs. In StaffVertex every AI call is recorded in a usage ledger tied to the feature that made it. When you can see the bill per feature, you make better decisions.
6. Make correctness cheap too
Bugs are a cost, and the expensive ones involve money. A few habits that cost nothing to adopt:
- Store money as integers in the smallest unit, not floating-point numbers.
- Derive totals and statuses instead of storing them, so they can't drift.
- Put the most important rules in one place and test that place well.
The POS has more than a thousand unit tests on its money, stock and licensing logic. That's not luxury. For a shop, a wrong total is the most expensive bug there is.
7. Spend money where failure is expensive
Being low-cost doesn't mean being cheap everywhere. I happily pay for reliable email delivery, proper backups and a database plan with backups for anything holding customer money. The point is to put money where a failure would really hurt, and save it everywhere else.
A quick checklist I use
- Can the user's device do this work?
- Can one app hold this for now, with clean internal boundaries?
- What is cached, and what really needs to be live?
- Where do files go, and who pays for moving them?
- Is this "smart" feature a rule or a model?
- What breaks if the free tier runs out, and what happens then?
Most of the time the cheapest system is also the simplest one. And simple systems are the ones that are still running happily two years later.