In short
For most business-critical systems, the safest way to modernize is gradual replacement rather than a big-bang rewrite. Refactor the parts worth keeping, and move functionality piece by piece into new components behind a routing layer, an approach known as the strangler fig. A full rewrite fits mainly small systems, or cases where the old system can be neither modified nor bypassed. Decide component by component, starting from the outcome you need, such as cheaper changes, a better process or retiring an unsupported platform. Migrate data in rehearsed steps with a way back, and keep shipping business features throughout.
For most business-critical systems, the best answer to rewrite or refactor is neither in its pure form: the safest route is gradual replacement, where the old system keeps running while you move it, piece by piece, into new code. A complete rewrite has its place, but it is the riskiest option and rarely the cheapest.
This guide explains what each option involves, why big-bang rewrites so often disappoint, how incremental strategies such as the strangler fig work, and how to handle the data. It ends with a decision table you can apply one component at a time.
What do rewrite, refactor and replace actually mean?
These terms are used loosely, which makes modernization discussions harder than they need to be. It helps to separate four options.
- Refactor. Martin Fowler defines refactoring as a change to the internal structure of software that makes it easier to understand and cheaper to modify, without changing its observable behavior. Done continuously and in small steps, it keeps a codebase healthy.
- Upgrade or replatform. Move to supported versions of the language, framework, database or hosting while changing as little behavior as possible.
- Replace gradually. Build new components next to the old system, shift functionality to them one slice at a time, and switch the old system off once nothing depends on it.
- Rewrite. Build a new system from scratch, then move everyone over when it is ready.
Most successful modernizations combine the first three. The full rewrite is the option that needs a strong justification, not the default.
Why are big-bang rewrites so risky?
A rewrite promises a clean slate, and the plan sounds simple: we know what the old system does, so we rebuild it with better technology. Martin Fowler writes that he and his colleagues have seen this simple-sounding plan fail most of the time. The reasons are consistent.
- Nobody fully knows what the old system does. Years of business rules, edge cases and fixes live only in the code. A replacement looks easy to specify, but rediscovering those details takes time, and some only surface after go-live.
- Part of that behavior is no longer wanted. Copying everything spends budget on features nobody needs.
- The business cannot wait. Replacing a serious system takes a long time, and new requirements keep arriving. They either go into the old system, widening the gap the rewrite must close, or they wait.
- Value arrives only at the end. The new system earns nothing until switch-over day, and that cutover is a single high-stakes event.
Ian Cartwright, Rob Horn and James Lewis describe organizations stuck on a treadmill of multi-year replacement programs. Promising feature parity with the old system led to plans for one big-bang cutover, changing business needs overtook those plans, and the legacy systems were never decommissioned.
How does incremental modernization work?
The alternative is to modernize while the system keeps running. Fowler borrowed the name strangler fig from a vine that grows around a host tree until it can stand on its own. In software, you start with small additions, often new features, built beside the legacy code, and move behavior out of the old system step by step.
Route traffic through a facade
Microsoft's architecture guidance describes the mechanics. A facade, typically a proxy, sits in front of the legacy system and sends each request either to the old application or to a new service. At first almost everything goes to the old system, then the facade routes each rebuilt slice to the new code until the old system handles nothing and can be retired. Users keep the same entry point throughout.
Extract one business capability at a time
Inside the code, the equivalent move is to pull out one capability, such as pricing, invoicing or notifications, behind a clear interface. Cartwright, Horn and Lewis call the places where a system can be split seams, and finding them usually means mapping how one large system serves several business needs. Each extracted capability can then be rebuilt, tested and released on its own.
Swap shared components with branch by abstraction
Some components are used everywhere, such as a data access layer or a framework. Branch by abstraction, as Fowler describes it, puts an abstraction layer in front of the old component, moves callers onto that layer, builds the new implementation behind it, then switches callers over part by part. The system keeps building and running throughout, so regular releases continue during the change.
When is a full rewrite the right call?
Gradual replacement is not always possible or worth the effort. Microsoft's guidance notes that the strangler fig pattern may not suit these situations:
- The system is small, and replacing it whole is simple.
- Requests to the old system cannot be intercepted, and you can change neither its code nor another integration point such as its database.
- You need to fully decommission the old solution quickly.
A business reason can also tip the balance: when a product's purpose has changed so much that little of the old behavior is still wanted, there is less to preserve. Even then, keep the rewrite narrow. Release the new system to one user group, region or product line first, and keep the old one running until the new one has proven itself.
How do you handle data migration?
Data is usually the hardest part, because legacy databases tend to be shared by many features, reports and integrations, some of them undocumented. A report or data warehouse job that reads tables directly can break silently when the data moves. Work through these steps.
- Find every reader and writer. List the features, reports, exports and scheduled jobs that touch each table before you move anything.
- Move one domain at a time. Microsoft's guidance describes extracting one domain's tables into a new database: load the history once, keep both copies in sync with change data capture while both systems run, and validate consistency before cutover.
- Rehearse on real volumes. Run the migration on a copy of production data, time it, and check the results with the people who use the data.
- Decide what to clean, archive or leave behind. Migration is the cheapest moment to fix formats and duplicates, and to stop carrying data you no longer need.
- Keep a way back. Rollback stays possible while the old tables and the sync still exist. Remove legacy objects only after the new system is validated, as a deliberate final step.
How do you decide? A decision table
Decide per component, not for the whole system at once, and start from the outcome you need. Cartwright, Horn and Lewis list common outcomes: reducing the cost of change, improving a business process, retiring an old system, and responding to imminent disruption such as a regulatory change or a new competitor. Newer technology for its own sake is not one of them.
The build or buy question applies to each component too. A commodity function such as invoicing or email can often be replaced by a product rather than rebuilt, as explained in build vs. buy.
How do you keep the business running while you modernize?
Modernization fails quietly when it starves the business of changes, or when one bad release shakes everyone's confidence. A few habits prevent both.
- Keep shipping features. Build new requirements into the new components where you can, so modernization and business requests stop competing for the same people.
- Release small and often. Automated tests around the riskiest flows and a repeatable deployment pipeline make each step easy to verify and to undo.
- Run old and new side by side. Compare results on real traffic before switching, or move a small share of users first and widen it as confidence grows.
- Measure outcomes. Track what your goal depends on, such as the time to ship a typical change, incidents, run costs and the share of traffic on new components.
- Change how the team works, too. Cartwright, Horn and Lewis warn that if ways of working stay the same, the replacement tends to end up as slow and costly to change as the system it replaced.
FAQ
How long does legacy modernization take?
It depends on the size of the system, the number of integrations, the state of the data and how much behavior must change. With a gradual approach, estimate slice by slice: discovery, build, data migration and a period of running old and new side by side. The whole effort can span many months, but value starts with the first slice rather than at the end.
Is refactoring enough, or do we need new technology?
If the platform is still supported and the main pain is slow, risky change, refactoring the busiest parts of the code usually comes first and pays back quickly. If the language, framework or database is out of support, refactoring alone will not fix that. You need at least an upgrade, and replacing the component becomes worth considering when no upgrade path exists.
Can we modernize without downtime?
Usually with very little. Because a facade routes the traffic and data stays in sync while both systems run, most slices can switch over without users noticing. Some steps, such as the final cutover of a large table, may still need a short planned window, so schedule them for quiet periods and rehearse them first.
How Synvica approaches modernization
Synvica usually starts with a short discovery phase to map the system, its data and its integrations, agree on the outcome and choose the first slice. One accountable team then covers product, design, engineering and operations, in two-week sprints that each end with a live demo, so you can watch functionality move from the old system to the new one.
You own the code and the cloud accounts at every step, with no lock-in. Learn more about our software modernization work and our process, or get in touch.
Written by the Synvica team, which designs, builds and runs custom software, web platforms, mobile apps and AI features.