47 Database Queries Per Product: How Technical Debt Slows Your Entire Network
Lessons from scaling a 200-location delivery network — and everything that went wrong
A client came to me with a simple complaint: "Our website is slow. We need better servers."
They were ready to spend serious money on infrastructure upgrades. New servers, more RAM, faster storage. The assumption was straightforward: slow site = weak hardware.
Before signing off on the budget, I asked if we could look at what was actually happening under the hood. What we found was embarrassing.
47 Queries Per Product
Every time a customer opened a product page, the system made 47 separate calls to the database. Not 47 queries to load the entire catalog — 47 queries for a single product.
Price? Separate query. Description? Separate query. Stock availability? Separate query. Related products? One query per related item. Reviews? Another query. Category info? Another one.
The developers had built it "the easy way" — each piece of data was fetched independently. When the catalog had 100 products, nobody noticed. It was fast enough.
Then the catalog grew to 70,000 products. And the site ground to a halt.
Here's the analogy I use: imagine a warehouse worker who needs to fulfill an order of 47 items. Instead of taking a cart and collecting everything in one pass, he walks to the warehouse, picks up one item, walks back, puts it down, walks to the warehouse again for the next item. 47 round trips for one order.
That's what the code was doing. Forty-seven round trips to the database for every page load.
The Fix
We consolidated queries — instead of 47, we brought it down to 3. We added caching for data that rarely changes (product descriptions, category names). We set up proper database indexes so the remaining queries ran faster.
Result: the site loaded 8x faster. Without buying any new hardware.
The development work took a few days. The cost was a fraction of what the server upgrade would have been. And unlike new hardware, the optimization would scale — when the catalog grew to 100,000 products, the site would still be fast.
Growth without chaos — launch in 1 day
Training, standards, gamification, and analytics — one operating system for your franchise family
Book a DemoWhy This Is a Franchise Network Problem
If your franchise network runs on a shared platform — whether it's an ordering system, a training portal, a booking tool, or an internal operations dashboard — technical debt in that platform affects every single location simultaneously.
Slow is expensive across a network. If your customer-facing platform takes 4 seconds to load instead of 1 second, that's not an inconvenience — it's a measurable conversion loss at every location. Studies consistently show that each additional second of load time costs 7-10% of conversions. Multiply that across your entire franchise network, and the revenue impact is substantial.
Franchisees blame the wrong thing. When the shared platform is slow, franchisees don't think "there's a technical debt problem in the database layer." They think "this software doesn't work." They get frustrated. They start looking for workarounds or alternatives. The trust in HQ's technology decisions erodes.
The problem gets worse with scale. This is the insidious part: technical debt that's invisible at small scale becomes crippling at franchise scale. A system that worked fine for 10 locations can collapse under the load of 100 locations. And by the time you notice, every location in the network is suffering.
The fix is usually cheaper than you think. Just like my client who was about to buy new servers, franchise networks often assume that performance problems require major investments — platform rebuilds, infrastructure upgrades, new vendor contracts. In most cases I've seen, an experienced developer spending a week on optimization delivers more impact than a six-figure infrastructure project.
What to Look For
If you suspect your franchise platform has performance issues:
- Measure actual page load times across different locations and times of day. If load times vary wildly, you likely have a capacity or optimization problem, not a hardware problem.
- Ask your technical team how many database queries execute per page. If they don't know, that's a red flag. If the number is higher than 10 for a standard page, there's optimization potential.
- Check if caching is implemented. Data that doesn't change often (product descriptions, menu items, training content) should be cached, not re-fetched on every request.
- Monitor performance as the network grows. What works at 20 locations might break at 50. Build performance monitoring into your platform operations, not as an afterthought when things get slow.
The Lesson
The instinct to throw hardware at a performance problem is understandable but usually wrong. The real issue is almost always in how the system is organized — not how powerful the hardware is.
In a franchise network, platform performance isn't a technical detail. It's an operational metric that directly affects revenue, franchisee satisfaction, and customer experience at every location. And it's one of the cheapest problems to fix — if you look at the code before you look at the server bill.
Growth without chaos — launch in 1 day
Training, standards, gamification, and analytics — one operating system for your franchise family
Book a Demo
Author
Ernest Barkhudarian
Founder
17 years building tech for multi-location businesses — from flower delivery networks to e-commerce operations. Writes about what he learned scaling operations across hundreds of locations, and why he built Franchise.Family.