Skip to content

Strangler Fig Pattern

Spicy — senior dev territoryArchitecture

ELI5 — The Vibe Check

Replacing a legacy system piece by piece instead of doing a risky big-bang rewrite. Named after the strangler fig tree that grows around another tree until it completely replaces it. Route traffic to the old system, build the new system alongside it, gradually redirect until the old one can be removed.

Real Talk

The Strangler Fig Pattern is an incremental migration strategy where a new system is gradually built alongside a legacy system. An intermediary (usually a reverse proxy or router) directs traffic to either system based on which features have been migrated. It reduces risk compared to full rewrites.

Show Me The Code

# Migration plan:
# Phase 1: Proxy routes all traffic to legacy
# Phase 2: /api/users → new service
#          /api/* → legacy
# Phase 3: /api/users, /api/orders → new
#          /api/* → legacy
# Phase 4: All traffic → new system
# Phase 5: Decommission legacy 🎉

When You'll Hear This

"Use the strangler fig pattern — we can't afford a full rewrite." / "We're strangling the monolith one service at a time."

Made with passive-aggressive love by manoga.digital. Powered by Claude.