← Lessons

quiz vs the machine

Platinum1780

System Design

The Strangler Fig Pattern

Replacing a legacy system piece by piece instead of in one risky big bang.

5 min read · advanced · beat Platinum to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. How does the strangler fig pattern replace a legacy system?

2. Why is the pattern lower risk than a big bang rewrite?