Legacy software turned into a monolith: rewrite or modernise?
Business software grown in layers that nobody dares touch any more? When to rewrite it from scratch and when to modernise it one module at a time, compared.
Published on · updated on November 26, 2026 · 10 min
In most cases, legacy software (old but still in use) that has become a monolith should not be rewritten from scratch: it pays to modernise it one module at a time, while it keeps working, and to put each new piece into use as soon as it is ready. Rewriting everything makes sense in a few specific cases: a small system, code that is truly beyond recovery, or software whose source code you don't have, where we are really talking about replacement. This is also what the Strangler Fig pattern recommends: a method described by Martin Fowler and documented by Microsoft.
Faced with old business software, the question is always the same: rewrite everything from the beginning or redo it one piece at a time? I answer from the point of view of a small or medium-sized business with PHP business software that has grown over the years, not of a multinational.
What a monolith is and why nobody wants to touch it any more
A monolith is software in which everything sits in a single block: invoicing, orders, inventory, login and reports share the same code and the same database, and every part depends on the others. It doesn't end up like this by mistake. It grows in layers: a feature for that client, an exception for that tax rule, a patch for that urgent bug.
The typical sign is this: the business software works, but every change takes weeks and breaks something somewhere else. Often it also runs on a version of PHP that no longer receives security updates. According to the Unsupported Branches page on php.net (consulted in November 2026), support for PHP 5.6 ended on 31 December 2018, for PHP 7.4 on 28 November 2022 and for PHP 8.1 on 31 December 2025.
It's not the fault of whoever wrote it: a monolith is almost always a sign that the software has been doing its job for years.
Rewriting everything from scratch: why it looks like the clean choice
You design a new system, write it calmly and one day switch off the old one. On paper it is the tidiest choice. In practice it gets stuck in three places.
Time. Martin Fowler, in his article on the Strangler Fig (August 2024), writes that he has seen this simple-sounding plan go up in smoke in most cases: replacing a serious system takes a long time, and the people who use it can't wait for new features. Meanwhile the old system still has to be maintained, and every change has to be made twice.
Hidden rules. Inside ten-year-old business software there are ten years of decisions that no document records. The most quoted case is still Netscape: in 2000 Joel Spolsky called the decision to rewrite the browser from scratch "the single worst strategic mistake that any software company can make", and pointed out that old code has been used, tested and fixed, with bugs that only surfaced after weeks of real-world use.
The "let's rebuild it exactly as it is" trap. Ian Cartwright, Rob Horn and James Lewis, in the Feature Parity pattern (martinfowler.com, 2021), explain that people who try to replicate the old system on a new technology vastly underestimate the effort, even just to define what it does today. And they end up rebuilding features nobody uses any more, or the odd workarounds created to get around old bugs.
Modernising module by module: how the strangler fig works
The name comes from a plant. Fowler recounts that in 2001, in the forests of Queensland, he saw strangler figs: they grow around a host tree until they can stand on their own and the original tree can disappear. Applied to software: the new system grows alongside the old one and takes its place one piece at a time.
The Microsoft guide to the Strangler Fig pattern (Azure Architecture Center, updated in May 2026) describes it like this: a façade, meaning a layer that receives the requests, routes them between old and new; with each step, more requests go to the new system; when the old one is no longer needed, it is switched off. The people who use the software keep seeing the same interface. The same guide asks you to validate data consistency before each step and points out that you can roll back until the old tables are removed.
Full rewrite or module-by-module modernisation: the comparison
| Full rewrite | Module-by-module modernisation | |
|---|---|---|
| First usable result | At the end of the project, all at once | After the first module |
| The software during the work | The old one must be maintained in parallel, changes are made twice | It stays on, the new modules come in one at a time |
| Rules hidden in the code | To be rediscovered, often once the software is already in use | Read in the module's code and carried into the new one |
| Risk of the switchover | Concentrated in one day | Split into many small, reversible steps |
| Stopping halfway | Leaves an incomplete, unusable new system | Leaves new modules already in use |
| Spending | Large and up front | One module at a time, starting with the one that pays off most |
| Suited to | Small systems, unrecoverable code, no source code | Business software and portals that work every day |
When rewriting everything makes sense
Module-by-module modernisation is not an absolute rule. Microsoft's guide itself lists the cases where the pattern may not be suitable: when the system is small and replacing it entirely is simple, when you have no access to the source code or to other points that can be changed, such as the database, when requests cannot be intercepted, and when the old system has to be removed quickly.
These are the questions I ask to decide.
| Question | If the answer is yes | If the answer is no |
|---|---|---|
| Do you have the source code and access to the database? | It can be modernised | We are talking about replacing it with new software |
| Is the software used every day by several people? | Module by module, so work doesn't stop | A complete rewrite may be simpler |
| Does it contain undocumented calculation rules, discounts or exceptions? | Module by module, reading them in the code | The risk of a rewrite goes down |
| Is the code readable, at least in part? | Module by module | If it is truly unrecoverable, it gets rewritten |
| Can someone in the company try out the new modules for an hour a week? | You can start | First that time has to be found |
If the software is small, a website or business software with few features, rebuilding it all is often the shortest route. Even then, though, the old one stays online until the new one has been tested: it's the method I describe in how to rebuild an existing website with artificial intelligence.
How I modernise business software one module at a time
- A written map. I read the code with AI tools that reconstruct tables, functions and the links between them (which part uses which) in a few days, then I check the critical points by hand and compare them with the people who use the business software every day. The map stays with you.
- The first module. I choose the one that hurts most: the slowest, the one nobody knows how to change, the one blocking an integration.
- The old system's rules. Before rewriting, I pin down what the module does today, odd discounts and exceptions included, in automated tests: checks that run again on their own.
- The rewrite. AI writes the first version; I review every line, correct it and sign it off.
- The comparison. The new module runs alongside the old one on the same data until the results match. No downtime: the business software stays on.
- Switching off. Only then is the old module switched off, and we move on to the next one.
The data stays where it is. If the database structure needs improving, I do it gradually and with test copies.
An example from my work
One example of how I read a process before touching it is CuraPiù, the care home management software I designed and built. There was no monolith to take apart: there was the medication chart on paper, vital signs copied into Excel and the resident's care plan (the PAI, as it is called in Italy) in Word, in other words the real rules of the work written down in different places. I brought them into the software one by one, starting with what is needed during a shift. The result can be measured: an activity is logged with the QR code in 3-5 seconds instead of 45-75, and a facility is up and running in 7 days.
The other example is about pace: since 2018 I have looked after the Youcanprint frontend, the part of the website that users see: a portal with millions of page views that evolves every week without stopping, through small, frequent updates.
When I take over code written by others, I measure the code and don't judge the people: every choice that looks strange today had a reason, often a rule that needs keeping.
Frequently asked questions
Is rewriting legacy software from scratch always a mistake?
No. Rewriting from scratch makes sense if the system is small and replacing it is simple, if the code is truly beyond recovery or if you don't have the source code. For business software used every day, with undocumented rules, module-by-module modernisation reduces the risk and delivers results sooner, without stopping the work.
What is the Strangler Fig pattern?
It's a method for modernising software one piece at a time. The new system grows alongside the old one, a façade routes requests between the two and, with each step, the new one takes over one more function. When the old one is no longer needed, it is switched off. The name was coined by Martin Fowler.
Does the business software stay up during the modernisation?
Yes. The new module runs alongside the old one on the same data until the results match, and only then is the old one switched off. There is no single day when everything changes over. It does, however, need someone in the company to spend about an hour a week trying out the new modules.
How much does it cost to modernise legacy business software?
You pay one module at a time, starting with the one that pays off most, so you decide how much to do and when. The cost depends on how many modules there are and how intertwined they are. After the free analysis you get an initial map and a written estimate for each module, with timing and priorities.
Where to start
The first step is not choosing between rewriting and modernising: it's understanding what is inside the software. That's what I do when modernising software that has become a monolith: I read the code, leave you a written map, choose the first module with you and replace it without stopping the people who work with it. If you want to see how I bring a real process into software, start with the CuraPiù case study. Book your free 30-minute analysis: you'll know where to start before you spend anything.