Strangler Fig Pattern: Replace Legacy Systems Safely

The Strangler Fig pattern lets you replace a legacy system by gradually growing a new one around it, eventually choking out the old code. It's used for modernizing critical systems where a "big bang" rewrite is too risky, routing traffic feature by feature.
The mental model
The Strangler Fig pattern lets you replace a legacy system by gradually growing a new one around it, eventually choking out the old code. A façade or proxy intercepts requests, acting like a vine wrapping around the old system. Over time, more and more functionality is routed to new services until the old system is fully 'strangled' and can be decommissioned.
How it works
The process is incremental. First, you place a façade, like an API gateway or proxy, in front of the legacy system. Initially, it routes all client requests to the old system. Second, you identify a piece of functionality and build it as a new, separate service. You then update the façade's routing rules to direct requests for that specific feature to the new service. All other traffic continues to flow to the legacy system. You repeat this process, feature by feature. Eventually, the legacy system no longer serves any traffic. At this point, you can safely decommission it and, finally, remove the façade so clients interact directly with the new system.
When to use it
Use this pattern for large, complex, and critical systems where a "big bang" rewrite is too risky or disruptive. It allows the application to remain fully functional and available to users throughout a long modernization effort. It's ideal when you can incrementally decompose the legacy system into logical modules or services.
When not to use it
This pattern is overkill for simple systems where a full rewrite is feasible. It's also a poor choice if the legacy system's functionality is so tightly coupled that you can't carve out individual features to replace. The added operational complexity of maintaining the façade and two parallel systems may not be justifiable for short-term projects.
One canonical example
A monolithic e-commerce application handles user profiles, product catalogs, and payments. To modernize it, a team places a proxy in front. They first build a new user profile microservice. The proxy is configured to route all /users/ requests to the new service, while /products/ and /payments/ still go to the monolith. Next, they build a new product catalog service and update the proxy to route /products/ traffic to it. This continues until the monolith handles zero requests and can be shut down.
Interview question
Which scenario presents the greatest challenge or unsuitability for applying the Strangler Fig Pattern?
- a.The modernization project has a very short timeline, making the overhead of a façade and parallel systems impractical.
- b.The organization prefers a phased approach to modernization to minimize risk.
- c.The legacy system is a critical, high-traffic application that cannot tolerate downtime.
- d.The legacy system's functionalities are so tightly intertwined that they cannot be isolated for independent replacement.Correct
Why? this is the answer
The Strangler Fig Pattern relies on incrementally replacing isolated features. If functionalities are too tightly coupled, it becomes impossible to carve out and replace individual pieces, rendering the pattern unworkable. While a short timeline makes the pattern less practical due to overhead, tight coupling makes its core mechanism unfeasible.
Just read this? Test yourself on what you have been reading.
Read the original → learn.microsoft.com
- #agile & scrum
- #system design
- #architecture pattern
- #legacy systems
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles