# Should we rewrite our software from scratch or refactor it?

> Refactor in almost every case. A full rewrite is justified only when the underlying platform is unsupported, the architecture makes your core business goals impossible, or nobody can safely change the code. Rewrites usually take two to three times longer than estimated, and the old system has to keep running meanwhile. Replacing it piece by piece is safer.

Dave Brown · CTO & Executive Advisor · Updated 2026-11-26 · [More on build vs. buy](https://davecto.com/answers/build-vs-buy)

Developers ask for rewrites because working in messy code is unpleasant, and a clean slate is appealing. But the existing software contains years of decisions about edge cases, customer quirks, and bug fixes that nobody has written down. A rewrite throws that knowledge away and has to rediscover it.

## Why are rewrites so risky?

Three things go wrong repeatedly:

- Time. A rewrite is estimated against the visible features, while the hidden behavior takes the extra months.
- Double running. You must keep fixing the old system while building the new one, so you pay for two teams' worth of work.
- No new value. For 9 to 18 months customers see nothing new, while competitors keep shipping.

I have seen a rewrite succeed and I have seen it sink a team. The difference was never the technology. It was whether the scope was controlled and the old system was retired in steps.

## When is a rewrite actually justified?

A rewrite makes sense when at least one of these is true:

1. The platform is end-of-life. Examples are an unsupported language version, a framework that no longer gets security patches, or a vendor that has shut down.
2. The architecture blocks the business. You need multi-tenant support, a new region, or real-time behavior that the current design cannot reach.
3. The code is unsafe to change. Every release breaks something and nobody understands the core module.
4. You cannot hire for the stack and cannot retain the people who know it.

Slow feature delivery, ugly code, or an unfashionable language on their own are not reasons. They are reasons to refactor.

## What is the alternative to a big-bang rewrite?

Replace the system piece by piece. This is often called the strangler approach: put new code in front of the old system, move one capability at a time to the new design, and delete the old part once the new one is proven. The old system keeps earning money the whole time, and you can stop or change course at any point. At Expedia I ran four teams through a service-oriented rewrite of two monolithic applications, and that kind of work only stays survivable when it ships in pieces.

The steps look like this:

1. Add tests around the behavior you care about, even crude ones.
2. Pick the part that hurts most or changes most often.
3. Build its replacement behind a switch and send a small share of traffic to it.
4. Compare results, then move everything over and remove the old code.
5. Repeat.

## How do I decide?

| Question | Points toward refactor | Points toward rewrite |
|---|---|---|
| Does the system make money today? | Yes, reliably | It barely works |
| Is the platform supported? | Yes | No, or being shut down |
| Can the team ship a small change safely? | Slowly, but yes | No |
| Is the problem one module? | Yes | Everywhere |
| Can we hire for the stack? | Yes | No |

Count which column wins. If most answers sit in the left column, refactor.

## What does each path cost?

A staged refactor typically takes 20 to 30 percent of engineering capacity for 6 to 18 months. A full rewrite of a mid-sized product (a team of 5 to 10 engineers for a year or more) often costs $500,000 to $2 million once you count the parallel maintenance. Get a written estimate with a time cap and a clear definition of done before agreeing to either.

## What I'd do

Start with the strangler approach and refactor the worst module first. Prove it improves delivery speed within a quarter. If after that you still find a hard blocker, such as a dead platform, make the case for a rewrite with numbers and a staged plan, not a feeling.

**Where I come in.** If this is a decision in front of you right now, it's the kind of thing I help with through [Technical Strategy](https://davecto.com/how-i-help#technical-strategy). A focused engagement scoped to the decision at hand — typically a few weeks of working sessions and review. Email [hi@davecto.com](mailto:hi@davecto.com) or see [Contact](https://davecto.com/contact).

## More on build vs. buy

- [How do I know if our technical debt is serious enough to stop feature work?](https://davecto.com/answers/build-vs-buy/when-is-technical-debt-serious)
- [How do I know if a quote for my MVP is reasonable?](https://davecto.com/answers/build-vs-buy/is-my-mvp-quote-reasonable)
- [Should I build or buy software for my business?](https://davecto.com/answers/build-vs-buy/build-or-buy-software)
- [How much does it cost to build an MVP in 2026?](https://davecto.com/answers/build-vs-buy/how-much-does-an-mvp-cost)
- [How long does it take to build an MVP?](https://davecto.com/answers/build-vs-buy/how-long-does-it-take-to-build-an-mvp)

---

Dave Brown · CTO & Executive Advisor · New York, NY · [hi@davecto.com](mailto:hi@davecto.com)

Site guide for agents: [llms.txt](https://davecto.com/llms.txt) · Sitemap: [sitemap.xml](https://davecto.com/sitemap.xml) · Any page is available as Markdown by sending `Accept: text/markdown` or adding `.md` to its URL.
