Concepts

Strangler Fig Pattern

Incremental migration strategy that gradually replaces a legacy system with new components, progressively routing traffic until the old system can be retired.

seed#strangler-fig#migration#legacy#pattern#modernization#architecture

What it is

The Strangler Fig pattern (named after the strangler fig tree) is a strategy for migrating legacy systems incrementally. Instead of a complete rewrite — the dreaded "big bang" that fails more often than it succeeds — new components are built that gradually replace functionality from the old system while it continues operating.

Martin Fowler described it in 2004, inspired by the strangler figs of Australia: seeds that germinate in the canopy of a host tree, grow roots downward, and eventually envelop and replace the original tree.

Why it matters

Complete rewrites are the graveyard of software projects. The Strangler Fig pattern offers a pragmatic alternative:

  • Controlled risk — each migration is small and reversible
  • Continuous value — the legacy system keeps working while the new one is built
  • Incremental learning — the team discovers hidden legacy requirements gradually, not at the end
  • Sustainable funding — continuous investment is justifiable because each iteration delivers value

Process

  1. Place a proxy/facade in front of the legacy system — this is the control point for routing traffic
  2. Implement new functionality in the new system for a specific route or feature
  3. Gradually route traffic to the new system (by percentage, user, or region)
  4. Validate and monitor — compare behavior between both systems
  5. Repeat until legacy receives no traffic
  6. Retire the legacy system when no longer needed

When to use it

  • Monolithic systems that need modernization but cannot stop
  • Database migrations where consistency is critical
  • On-premise to cloud transitions
  • Replacement of obsolete frameworks or languages

When not to use it

  • Small systems where a rewrite takes less than a sprint
  • When the legacy system has no clear interface to intercept
  • If there is no way to selectively route traffic

Variants

VariantMechanismWhen to use
Strangler Fig (classic)HTTP proxy gradually redirects trafficMigrating web monolith to microservices
Branch by AbstractionInternal code abstractionReplacing internal components without changing the API
Parallel RunRun both systems and compareWhen correctness is critical (payments, calculations)
Feature ToggleFeature flags control which users see the new systemGradual migration by user segment

References

Concepts