Rescue or Rewrite? How to Decide What to Do With a Struggling Web Application
Key Takeaways
- Most struggling web applications should be rescued incrementally, not rewritten from scratch. Full rewrites take longer than planned and lose knowledge the old system quietly encodes.
- A rewrite is justified when the foundation itself is wrong (unsupported technology, a data model that can't represent the business, or code nobody can safely change), not just because the code is ugly.
- Start with an assessment: you can't make this decision well without knowing what is actually in the codebase and in production.
- Incremental replacement, piece by piece behind stable interfaces, gets most of a rewrite's benefits with a fraction of the risk.
Every team with a fragile product eventually asks the same question: do we fix what we have, or throw it away and start again? A rewrite is tempting because it promises a clean slate. A rescue is less exciting but usually safer. This guide gives you a practical way to decide.
Signs your application needs attention
You don't need to read the code to know something is wrong. The symptoms show up in the business:
- Every change breaks something unrelated. Small features take weeks because nobody can predict the side effects.
- The system slows down or fails as usage grows. Performance problems appear under real load.
- Data can't be trusted. Reports disagree, records are duplicated or inconsistent, and people keep their own spreadsheets "just in case".
- Knowledge sits with one person, or with a previous developer or agency who is no longer around.
- Security updates are postponed because upgrading dependencies feels too risky.
- Incidents repeat. The same kind of outage or bug keeps coming back after being "fixed".
These symptoms tell you there is a problem. They don't tell you whether rescue or rewrite is the answer.
Why full rewrites are riskier than they look
Rewrites fail in predictable ways:
- The old system knows more than anyone remembers. Years of bug fixes and edge-case handling live in the code, often undocumented. A rewrite has to rediscover all of them, usually in production.
- The business doesn't stop. While the new system is built, the old one still needs fixes and features. You end up maintaining two systems, or freezing the product.
- Scope grows. "While we're at it" turns a rewrite into a redesign. Fred Brooks named a version of this the second-system effect in The Mythical Man-Month: the tendency to over-engineer the replacement.
- Nothing ships until everything ships. A big-bang rewrite delivers no value until cutover day, which is also when the risk peaks.
Joel Spolsky's well-known essay Things You Should Never Do makes the case against rewrites from experience. It's an old argument, and it still holds for most products.
When a rewrite is the right call
Rewrites are justified, but for specific reasons:
- The technology is a dead end. The framework or platform is unsupported, insecure, or impossible to hire for, and upgrading is effectively a rewrite anyway.
- The data model can't represent the business. If the core structure of your data is wrong, everything built on it inherits the problem.
- The product has fundamentally changed. What you need now has little in common with what was built.
- The codebase is small enough that rewriting it is cheaper than understanding it.
Even then, a rewrite rarely has to be big-bang. It can be done incrementally.
A simple decision framework
| Question | Points toward rescue | Points toward rewrite |
|---|---|---|
| Is the technology supported and secure? | Yes, or upgradable step by step | No, and upgrading means starting over |
| Does the data model fit the business? | Mostly, with fixable issues | No, the core structure is wrong |
| Does the product still do the right job? | Yes, it just does it badly | No, the business has moved on |
| How large is the system? | Large, with lots of embedded logic | Small and easy to replace |
| Can the business tolerate a long freeze? | No | Yes, or you can run both systems |
If most answers fall in the left column, rescue. If the technology or data model answers fall clearly in the right column, plan a replacement, ideally an incremental one.
How an incremental rescue works
A good rescue follows the same order every time:
- Assess. Read the code, the infrastructure and the deployment process. Identify what is risky, what is worth keeping and what is actively causing incidents. A technical audit is often the first step.
- Stabilize. Fix what is causing outages, data corruption or security exposure first. Add monitoring so problems are visible before customers report them.
- Create safety nets. Add tests around the most important behaviour, so later changes don't silently break it.
- Restructure step by step. Improve the worst parts one at a time, with each step deployable on its own.
- Replace where needed. For components that really must be rebuilt, replace them behind a stable interface while the rest of the system keeps running. Martin Fowler calls this the strangler fig pattern: the new system gradually grows around the old one until the old parts can be removed.
The business keeps shipping throughout, and every step reduces risk instead of concentrating it at the end.
Data deserves special attention. Inconsistent data is usually a symptom of logic that allows it. Fixing records without fixing the logic means they will drift again.
Questions to ask before deciding
- What are the three problems costing us the most right now: in time, revenue or risk?
- Which parts of the system are stable, and which cause most incidents?
- What do we know about the system that isn't written down anywhere?
- What would we lose if we froze new features for six months?
- Who will own the system afterward, and will they be able to understand it?
Frequently asked questions
Can a new team take over a codebase written by someone else? Yes. It starts with reading the code and the production setup carefully, then stabilizing before making significant changes. This is the core of our software rescue work.
How long does a rescue take? Stabilization usually comes first and fastest; the structural improvements continue alongside normal feature work. The point of an incremental approach is that you see improvements early instead of waiting for a cutover date.
What if the original developer is unavailable? That is common, and it's one reason to document the system as part of the rescue so you're never dependent on a single person again.
Our site was hacked. Is that a rescue or a rewrite? Neither, at first. A compromise needs investigation and cleanup before anything else, because attackers often leave persistence behind. See our incident response service and our write-up on a WordPress SEO spam infection.
If your product feels fragile and you're weighing a rewrite, talk to us first. We'll look at what you have and give you an honest recommendation, even if that recommendation is to keep most of it.