Insights · Cloud & Platform
Legacy modernization with the strangler fig pattern
By the Cystem X Engineering Team - Published - 5 min read
In this article
Big-bang rewrites of critical systems have a long record of running late, over budget and sometimes never finishing. The strangler fig pattern offers an alternative: build new functionality around the old system, route traffic gradually to the new parts and retire the legacy components as they become unused.
Why rewrites fail
A rewrite must reproduce years of accumulated behavior, including undocumented rules, while the business keeps changing the old system. Benefits arrive only at the end, which hides problems until it is late.
Incremental replacement delivers value early and reduces risk at every step.
Understand what you have
Document the system through code review, data analysis and conversations with the people who use it. Identify capabilities, interfaces, data stores and dependencies. Characterization tests that record current behavior give a safety net for change.
Decide which parts are worth keeping, replacing or removing entirely.
Make the new system grow where the old one used to be, one capability at a time.
Introduce a facade
Place a routing layer, such as an API gateway or reverse proxy, in front of the legacy system. Initially it passes everything through. Later it directs selected requests to new implementations, allowing gradual switching and quick rollback.
The facade also provides a place to add authentication, logging and monitoring around the old system.
Choose slices wisely
Pick capabilities that are well bounded, valuable and relatively low risk to start, then proceed to more central ones. Slice by business capability rather than by technical layer, so each piece delivers something users can see.
Run old and new in parallel for a period and compare results before switching.
Handle data deliberately
Data is the hardest part. Options include synchronizing between old and new stores, using change data capture, or letting the new component own its data and exposing it back to the legacy system through an interface. Avoid long periods in which two systems both write the same data.
Plan reconciliation checks and a clear cutover for ownership of each dataset.
Avoid permanent coexistence
Without discipline the new system becomes just another thing alongside the old. Set milestones for decommissioning each legacy component, and track retired functionality and cost savings.
Funding and leadership attention must persist until the old system is genuinely switched off.
Modernize the practices too
Adopt automated testing, continuous delivery and observability with the new components, so the organization improves how it builds as well as what it builds.
Celebrate each retired component. They represent real, permanent risk reduction.
Key takeaways
- Avoid big-bang rewrites and deliver value incrementally.
- Capture current behavior with characterization tests.
- Introduce a routing facade to switch traffic gradually.
- Slice by business capability and plan data ownership.
- Set decommissioning milestones so the old system actually disappears.
Sources and further reading
This article reflects general practice and publicly available guidance. Teams should consult primary sources, including Martin Fowler writing on the strangler fig application, and cloud provider modernization guides for incremental migration patterns, and adapt the guidance to their own environment, risk appetite and legal obligations.
Keep reading
More engineering guidance from the Cystem X team.
Cloud & Platform
Modular monolith or microservices: how to choose
A balanced look at team size, deployment, data and operations to choose an architecture deliberately.
Read articleCloud & Platform
Chaos engineering: testing resilience on purpose
Inject failure deliberately, with hypotheses and safeguards, to find weaknesses before customers do.
Read articleCloud & Platform
Disaster recovery architecture: RTO, RPO and the patterns that meet them
From backup and restore to active-active: pick the pattern that matches your recovery objectives.
Read articleSoftware Engineering
Modernize without betting the business.
We plan and deliver incremental modernization of critical systems with measured risk.
Explore Software Engineering