Strangler Fig Pattern

Legacy migration, incremental modernization, route-based migration, and feature toggles for safe rollout.

Overview

Overview The Strangler Fig pattern incrementally replaces a legacy system by building new functionality around it, gradually routing traffic from the old system to the new one until the legacy system can be decommissioned. The name comes from the strangler fig tree, which grows around a host tree, eventually replacing it entirely.

This pattern is the antithesis of the "big bang rewrite," which Martin Fowler and most experienced engineers warn against. Big rewrites are risky because you must replicate years of accumulated functionality before you can switch over, and during the rewrite, the old system continues to evolve, creating a moving target.

The strangler fig approach is battle-tested at companies like Amazon (migrating from monolith to microservices), Shopify (modular monolith extraction), and the UK Government Digital Service. In interviews, it demonstrates architectural maturity — you understand that migration is a process, not an event, and that risk management matters as much as technical design.

Key concepts

  • Incremental legacy replacement
  • Route-based migration
  • Anti-corruption layer (ACL)
  • Feature toggles and dark launches
  • Parallel running and comparison
  • Data migration strategies
  • Rollback safety

Interview questions

  • How do you implement the Strangler Fig pattern step by step?
  • What is an anti-corruption layer and why is it essential during migration?
  • How do you handle data migration during a strangler fig migration?
  • What are the common pitfalls and failure modes during a strangler fig migration?

Sign up free to read the full topic

More Microservices topics

Start free on Cariara · Coding problems · System design studio