Course contentsShow
← Software Engineering
Lesson 1774 of 1,93351. Legacy Code and Brownfield DevelopmentFree lesson

The Strangler Fig Pattern: Concept and Origin

Understanding the biological metaphor and how it applies to gradually replacing legacy systems without disruption.

The Strangler Fig Pattern: Concept and Origin

What you'll learn: How a biological process inspired one of the most effective strategies for replacing legacy systems incrementally.

The Biological Metaphor

In nature, strangler fig trees begin life as seeds deposited high in a host tree's canopy. The fig sends roots down to the ground while growing upward toward sunlight. Over years, these roots thicken and gradually envelop the host tree. Eventually, the host dies and decomposes, leaving the fig as a self-supporting structure—often without observers noticing the transition.

Application to Software

Martin Fowler coined the "Strangler Fig Application" pattern (or simply "Strangler Pattern") to describe gradually replacing a legacy system. Instead of a risky "big bang" rewrite, you build new functionality around the edges of the old system, slowly routing more traffic to the new components while the legacy system continues operating.

The key insight: both systems coexist during migration. The old system isn't turned off until the new one has completely replaced it, piece by piece. Users experience no downtime, and you can validate each replacement incrementally.

Why This Matters for Legacy Systems

This pattern directly addresses the legacy code dilemma you've studied: fear of change versus the need for modernization. Rather than the all-or-nothing choice between "live with it" or "rewrite everything," the Strangler Pattern offers a third path—gradual, low-risk replacement.

You've already learned about seams, Branch by Abstraction, and incremental migration. The Strangler Pattern is the architectural philosophy that unifies these techniques into a coherent migration strategy.

Key Takeaway: The Strangler Fig Pattern leverages the biological metaphor of gradual replacement—building new systems around legacy ones, routing functionality incrementally, and allowing the old system to be safely decommissioned only after complete replacement, minimizing disruption and risk.