Our view
For most systems that run a business, we'd move it piece by piece. Each part is rebuilt, run beside the old one, and switched over once the two agree.
Starting again can feel simpler than untangling old code. Usually it takes longer than planned, and nothing reaches users until the end.
There are cases where starting again is right. We list them below.
Why full rewrites stall
Old code holds fixes that nobody remembers. Joel Spolsky made this point in 2000.
An odd-looking line is often the cure for a bug someone found the hard way. A rewrite throws those fixes away, and the bugs return one at a time after launch.
His example was Netscape, which rewrote its browser from scratch. It skipped version 5, and nearly three years passed between major releases.
Spolsky blamed the rewrite for the market share Netscape lost in that time.
Defining "the same as today" is harder than it sounds. Thoughtworks consultants Ian Cartwright, Rob Horn and James Lewis call this goal feature parity.
In their experience, agreeing on what the old system does took a huge effort. That effort led to plans for one large switch-over, while the business kept changing underneath.
Martin Fowler adds a further point. Much of what an old system does is no longer wanted, so copying all of it wastes effort.
What moving piece by piece means
Fowler named the approach after the strangler fig. The fig grows around a host tree until it stands on its own.
In software, new parts are built beside the old system. A routing layer sits in front and sends each request to the old part or the new one.
Microsoft's architecture guide calls this layer a façade. Users keep using the same screens and addresses.
Over time, more requests go to the new parts. Each old part is switched off once nothing needs it.
The gains are practical. Each step is small enough to undo.
Users get value from the first part, without waiting for the last.
You also learn as you go. What the first part teaches you shapes the price and plan for the next one.
What it costs
Running two systems side by side needs temporary code to connect them. Fowler calls it transitional architecture.
It can feel like waste. Fowler argues the lower risk is worth the cost.
Shared data is the hardest part. While both systems run, both may need the same records, so data has to stay in step.
It also takes discipline to finish. If the last old parts are never switched off, you pay to run both systems indefinitely.
| Full rewrite | Piece by piece | |
|---|---|---|
| When users see value | At the end | From the first part |
| Risk at switch-over | All at once | One part at a time |
| Extra cost | The old system runs untouched until launch | Temporary code to run both |
| Best for | Small systems, or ones that can't be split | Large systems the business depends on |
When we'd start again
- The system is small. Microsoft's guidance notes the pattern may not suit a small system that's simple to replace whole. A few screens and one database can often be rebuilt in weeks.
- You can't get between users and the system. The routing layer needs a way to catch requests. Without access to the code, the database or the traffic, there's nowhere to put it.
- The business has moved on. If most of the old rules are no longer wanted, copying them makes little sense. You write down what still matters, and build for that.
- The old platform must go by a date. A vendor may end a product, or a contract may expire. Then a faster, larger switch may be the only option.
Even then, two steps keep the risk down. Write down what the old system does before you build. Then run both on the same work before you switch.
What to do
- Ask for a written map of the old system before anyone proposes a plan.
- Choose a first part that's low in risk and visible to users.
- Ask how each switch can be undone, and test that before it happens.
- Agree when and how each old part is switched off and archived.
If someone proposes a full rewrite, ask which of the cases above applies. If none does, ask how users will get value before the end.
