Engineering
Legacy modernization: incremental replacement or a full rewrite?
When is a rewrite actually worth it?
Replace in slices when customers need the existing platform to stay up and you can isolate a capability. Consider a rewrite if the replacement scope is bounded, key behavior is documented, and the team can support both systems until cutover.
Prefer incremental replacement when the existing system must keep serving customers and you can isolate meaningful boundaries. Consider a full rewrite when the scope is genuinely bounded, the replacement contract is understood, and coexistence would be harder than a controlled cutover.
Neither option is automatically cheaper or safer. The decision should follow the business capability you need to improve, not the team's frustration with the current codebase.
1. Incremental replacement
The old system keeps handling what has not moved. New components take over selected responsibilities, often behind a façade that routes requests between the two. You can validate a smaller capability in production before you commit the next slice.
Incremental cons:
- Two systems mean two deployment paths, cross-system calls, and unclear data ownership
- The façade can become a bottleneck, and the old system can stay forever without an exit plan
Best for: large or important systems that must stay up and have boundaries you can intercept. Each slice needs a completion condition: which traffic moved, which dependencies remain, and what can actually be retired.
2. Full rewrite
A rewrite can fit a small, well-understood system, or a component whose boundaries make gradual replacement impractical. The destination can be simpler. The transition concentrates discovery and migration risk into one larger change.
Rewrite cons:
- Undocumented behavior can still be a requirement. A new system can match the happy path and fail on permissions, history, or rare exceptions
Best for: bounded functionality, explicit acceptance criteria, and a team that can keep the current service running while the replacement is finished. Unpleasant code is not, by itself, a reason to rewrite.
Make data ownership the central question
For either option, list who owns writes during the migration, how historical data moves, and how consistency will be checked. Do not treat dual writes as if they were one transaction. A failure can update one side and leave the other unchanged.
Map the important callers, outputs, access rules, background jobs, and external dependencies. Build tests around outcomes the business depends on. Changing a legacy behavior should be a deliberate operating decision.
Ask both proposals the same questions: how long must two systems coexist, who supports them, what proves correctness, how does cutover happen, and what makes reversal possible? My default is incremental modernization with explicit retirement milestones.
Test one seam before committing
- Pick a capability with clear inputs, outputs and a data owner. Capture current behavior, including permissions, old records and uncommon cases.
- Route requests through an interface you control. Compare read-only shadow results without replaying writes or side effects. Set exit criteria for the slice before moving traffic.
- Backfill and reconcile the data. Choose one authoritative writer per phase, define how changes are replicated and check counts and business invariants before turning on the new path.
- Canary a small share of traffic. Set a rollback window, specify how to recover writes made during that window, and retire the legacy path only after the slice meets its criteria.
Prove the replacement is correct
Check data consistency and customer outcomes as well as uptime and latency. If results differ, separate an intentional behavior change from an accidental regression before ramping up.
Frequently asked questions
Do we need microservices to modernize?
No. Use the boundary that lets you replace the capability safely. It can stay a module in the same application.
How long should old and new coexist?
Long enough to see representative traffic and prove the agreed behavior. Set a review date and retire the old path once it passes rather than letting both versions run indefinitely.
Read next: 3 CI/CD guardrails that let engineering teams ship faster without breaking production.
If you are deciding how to replace a system, tell me the business constraint, the data boundary, and what must keep working throughout the transition.
Message me