Recipe
Strangler Fig Migration
Incrementally replace a legacy system by routing traffic to new services until the old system withers away.
The Pattern
A strangler fig grows around a host tree, eventually replacing it entirely. In software, you place a facade in front of the legacy monolith and gradually redirect endpoints to new microservices. Over time, the legacy footprint shrinks to zero.
Steps
- Identify a bounded context to extract first.
- Build the new service behind a feature flag.
- Route a small percentage of traffic to it.
- Monitor parity — logs, metrics, error rates.
- Ramp to 100% once confidence is high.
- Delete the old code path.
- Repeat until the monolith is empty.
Guardrails
- Never modify legacy and new systems simultaneously.
- Keep the routing layer dumb — no business logic.
- Use dark launches to validate without user impact.
- Maintain rollback ability for every extraction step.