How it works · 11 of 49 Core
What is the strangler fig pattern for replacing legacy systems?
Replacing a system while it runs
Strangler fig: A strangler fig replaces an old system one piece at a time while it keeps serving: a façade (a proxy every request already passes) sends each route either to the old system or to the new one, routes move across one by one, any route can be sent back in one switch, and the old system is switched off only when nothing calls it. The price is transitional code you will throw away, and two systems run side by side for months.
Loading the animation…
Say it like this A strangler fig puts a façade in front of the old system and moves one route at a time to the new one, so each failure is small and reversible, and the old system goes only when nothing calls it.
Under the hood — for builders
- The source, in its words
- Martin Fowler named the pattern after strangler figs he saw in Queensland in 2001: vines that grow round a host tree until the host may die, leaving the fig "as an echo of its shape." On the alternative, a full rewrite cut over at once: "we've seen this simple-sounding plan go down in flames most of the time." ("Strangler Fig", martinfowler.com, 2024 edition.)
- The four phases, as Microsoft draws them
- Façade: a proxy that "intercepts requests that go to the back-end legacy system" and routes each one "either to the legacy application or to the new services." Customers "continue to use the same interface." Share of requests per phase (the split is illustrative; the order is Microsoft's):
- Run here: what the façade costs, and what a rollback costs
- A Python façade in front of two tiny servers (old and new), all on one machine, routing by path. The extra hop roughly doubles a local request; sending /checkout back to the old system is one table entry:
- Transitional architecture
- Code built only so old and new can live together (the façade, adapters, data sync), deleted at the end. Fowler: worth it, because "the reduced risk and earlier value" outweigh its cost.
- Shared data
- The hardest part is usually the database both systems touch. Microsoft: copy one domain's tables out, keep them in sync with change data capture, check, then cut over; rollback stays possible until the old tables are removed.
- Measure it
- Share of requests on the new system · routes moved per month · rollbacks per route · façade latency and error rate · old-system call count (aim: zero).
- Watch out
- The façade must not become a bottleneck or single point of failure. Don't use it if requests can't be intercepted, or the system is small enough to replace at once.
- Sources
- Fowler, "Strangler Fig", martinfowler.com, 22 Aug 2024 · Microsoft, "Strangler Fig pattern", Azure Architecture Center, learn.microsoft.com, read in session · toy façade, Python, run 19 Nov 2026.
What happens in the strangler fig animation, step by step?
- An old system that every customer still uses. Rewriting it all and switching over in one night is the plan that most often fails.
- First, a façade: one gate every request passes. Nothing changes for customers; every route still goes to the old trunk.
- Your turn: slide routes from old to new, one at a time.
- Checkout breaks on the new side. The gate sends that one route back to the old trunk while it's fixed, then moves it again.
- Nothing calls the old system any more, so it is switched off. The new one stands in its shape.
- The price: a gate and bridge code you'll throw away, and two systems run side by side for months. Next: one front door per client.
What everyday example explains strangler fig?
A new bridge built beside the old one. Traffic moves one lane at a time; if a lane on the new bridge cracks, the cones go back and cars use the old lane while it is fixed; the old bridge comes down only when it carries no one.
Why should a team care about strangler fig?
Most big systems that need replacing are the ones the business can't stop. Moving one route at a time delivers value early, keeps each failure to one route, and keeps the way back open. Plan the gate first, move the routes that hurt most first, and budget for the bridge code you'll delete.