Skip to main content
Pattern

Strangler-fig

Problem

You have a legacy monolith you want to replace, but a big-bang rewrite is too risky.

Context

Rewriting is expensive and error-prone. Any 'V2' project that ships in 2 years fails to keep up with 2 years of legacy changes.

Solution

Introduce a facade (proxy, gateway) in front of the legacy system. Route specific pieces of functionality to a new implementation gradually. Over time, more and more routes go to the new system. Eventually the legacy is 'strangled' and can be retired.

Trade-offs

  • Two systems co-exist for a long time — dual maintenance
  • Data may need to sync between old and new during transition
  • Route configuration becomes a critical failure point

Failure modes

  • Migration never finishes — 'temporary' legacy runs for decades
  • Data sync fails, systems diverge
  • Facade becomes a bottleneck

When to use

  • Large legacy replacements
  • Zero-downtime migrations
  • When you can't take a rewrite outage

When NOT to use

  • Small legacy systems — just rewrite
  • You have a viable feature freeze on legacy