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

  1. Put a facade in front of the legacy system: an API gateway, load balancer, proxy or routing layer that all traffic passes through.
  2. Pick a slice of functionality, ideally one with clear boundaries and real business value, and build it as a new service.
  3. Route that slice to the new service through the facade. The legacy system still handles everything else.
  4. Repeat, slice by slice, learning as you go.
  5. Switch off the legacy system when nothing routes to it any more. Then actually decommission it.
Strangler fig: replacing a legacy system slice by slice1. Facade in frontFacade / router2. Slice by sliceFacade / router3. Switch it offFacade / routerLegacy systemNewserviceLegacyNew servicesdo everythingLegacy: offtime
A facade routes traffic; slices move to new services one at a time until the legacy system can be switched off.

When to use it

Trade-offs

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.