Back to engineering notes
Architecture6 min read·

A Founder Almost Paid $20,000 for a Rewrite. We Fixed It in 10 Days for $3,500.

Server costs were spiking, queries were timing out, and the agency said the stack couldn't scale. A technical audit told a different story.

ArchitecturePerformanceTechnical debtCachingFractional CTO
Abstract architecture diagram showing database indexes, Redis cache, and async job queues optimizing a production app

A growing product team came to me with a familiar headache: cloud bills climbing every month as traffic grew, database queries timing out during peak hours, and a previous agency insisting the stack didn't scale.

Their recommendation was blunt — throw it away and rebuild from scratch. The quote: $20,000 and three months of zero feature output.

Here is how we saved the app — and roughly $15,000 in runway — in 10 days flat, without rewriting a line of the core product.

01

The problem looked like a rewrite

From the outside, everything pointed at the stack. Response times were painful. Peak traffic made the database stall. Monthly server spend kept rising even though the product itself hadn't changed much.

When an agency says “this doesn't scale,” founders hear a verdict. What they often get instead is a sales pitch for a clean-slate rebuild — easier for the vendor, expensive for the company, and usually unnecessary.

A rewrite quote is not a diagnosis. It is a proposal. Treat it like one.
02

The diagnosis: architecture bottlenecks, not a bad stack

Before burning cash on a rewrite, we audited the existing codebase. The stack wasn't the issue. The real bottlenecks were classic and fixable.

  • Unindexed database queries: Hot paths were pulling thousands of unneeded rows into memory on every request.
  • Synchronous heavy work: Payload processing was happening on the main request thread instead of background job queues.
  • Zero caching: Static and infrequently updated API responses were regenerated from scratch every time.
03

What we fixed instead of rewriting

We kept the working application and targeted the bottlenecks directly.

  • Database and query layer: Refactored the heavy calls, added the missing indexes, and stopped loading data nobody needed.
  • Redis caching: Cached hot and infrequently changing responses so the database stopped doing the same work on every hit.
  • Async job queues: Moved heavy processing off the request path so users weren't waiting on background work.
  • Infrastructure routing: Tightened how traffic hit the servers so peak load stopped amplifying every inefficiency.
04

The result

Ten days later, the product was still the same product — just dramatically cheaper and faster to run.

Before vs after
MetricBeforeAfter
Monthly cloud server billClimbing with trafficDown ~65%
API response times~2.4sUnder 180ms
Cost to fix$20,000 rewrite quote~$3,500
Timeline3 months, no features10 days
05

The takeaway for non-technical founders

When your app slows down, developers will often tell you to rewrite everything. Starting clean is easier than debugging old code — for them. For you, it is usually the most expensive option on the table.

About 80% of the time, you don't have a code problem. You have an architecture bottleneck: missing indexes, sync work that should be async, no cache layer, or infrastructure that amplifies every inefficiency.

Always get a neutral technical audit before throwing away working software. A second opinion costs a fraction of a rewrite — and often saves the runway you need to keep shipping features.

Working software with bottlenecks is almost always cheaper to fix than a greenfield rebuild.