The rewrite trap
Replacing a large legacy system with a single big bang rewrite is famously risky. The new system must match years of behavior before it can launch, and during that long build the old system keeps changing underneath you.
Strangle it gradually
The strangler fig pattern, named after a vine that slowly grows around a tree, replaces a system incrementally. A facade or router sits in front of the legacy system and intercepts traffic.
- Pick one capability and build it in the new system.
- Route just that capability's traffic to the new code while everything else stays on the legacy path.
- Repeat capability by capability until the legacy system handles nothing and can be retired.
Why it works
Each step is small and reversible. If a migrated piece misbehaves, you route that slice back to the legacy system. Risk is spread across many tiny releases instead of concentrated in one terrifying launch.
Key idea
The strangler fig pattern routes traffic through a facade and migrates one capability at a time to a new system, so a legacy replacement happens in small reversible steps rather than a big bang.