← Back to Docs
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

  1. Identify a bounded context to extract first.
  2. Build the new service behind a feature flag.
  3. Route a small percentage of traffic to it.
  4. Monitor parity — logs, metrics, error rates.
  5. Ramp to 100% once confidence is high.
  6. Delete the old code path.
  7. 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.