Strangler Fig
Gradually replace a legacy system by building new functionality around it and redirecting traffic to the new implementation, one piece at a time, until the old system has nothing left to do and can be switched off.
The name comes from Martin Fowler, after the strangler fig vines that grow around a host tree until they can stand on their own.
The problem
Big-bang rewrites of large systems fail with depressing regularity. They take years, the old system keeps changing while the new one is built, value is delivered only at the very end, and the riskiest moment, the cut-over, is also the moment of least knowledge and most pressure. It’s waterfall in disguise.
The solution
- Put a facade in front of the legacy system: an API gateway, load balancer, proxy or routing layer that all traffic passes through.
- Pick a slice of functionality, ideally one with clear boundaries and real business value, and build it as a new service.
- Route that slice to the new service through the facade. The legacy system still handles everything else.
- Repeat, slice by slice, learning as you go.
- Switch off the legacy system when nothing routes to it any more. Then actually decommission it.
When to use it
- Replacing or modernising a large, business-critical system that can’t be frozen during a rewrite.
- Migrating to the cloud with a refactor strategy.
- When you need to deliver value and reduce risk continuously, rather than at the end.
Trade-offs
- Data is the hard part. Old and new often need the same data for a long time. Expect synchronisation, change data capture or anti-corruption layers, and design them deliberately.
- You run two systems for a while, with the cost and operational overhead that brings. Keep the transition moving so “temporary” doesn’t become permanent.
- The facade becomes critical infrastructure and must be resilient and observable.
- Choosing slices well takes skill. Slices cut along technical layers rarely work; slices cut along business capabilities usually do.
Why it works
The strangler fig is a risk-driven lifecycle applied to legacy replacement. Every slice is a real release into production, delivering value and proving (or disproving) the new architecture with working software, while there’s still time to change course. You learn on the small slices before you bet on the big ones.
The riskiest step in a big-bang rewrite is the last one. The strangler fig makes every step small.