Strangler Fig Pattern
Incrementally replace a legacy system by building the new system alongside it, routing traffic over gradually until the old system is retired.
★★★★★3/5System topology — how multiple services are organised
How it works
Named by Martin Fowler after a parasitic fig tree that grows around its host, the Strangler Fig pattern allows safe incremental migration from a monolith to microservices.
A facade (often an API Gateway or proxy) sits in front of the legacy system. New functionality is built as new services. The proxy routes requests to either the legacy system or a new service. Over time, more and more routes are migrated until the legacy system handles nothing and can be decommissioned.
This avoids the 'big bang' rewrite that historically fails.
Why it matters
Big-bang rewrites carry enormous risk. The Strangler Fig pattern is the industry-standard strategy for safely migrating from a legacy monolith.
✓ When to use
- →Migrating from a legacy monolith to microservices
- →When the legacy system cannot be taken offline for rewrite
- →Feature-by-feature migration with business continuity
✗ When NOT to use
- →When the legacy system is too entangled to proxy safely
- →Greenfield projects — no legacy to strangle
Trade-offs
Low risk — incremental, reversible migration
Running two systems simultaneously increases operational cost
Business continuity during migration
Proxy adds a network hop and potential bottleneck
In production
Strangler Fig used to decompose original retail monolith
Gradual replacement of monolith with services over several years
Industry adoption
Related principles
Microservices Architecture
LiveDecompose an application into small, independently deployable services that communicate over a network.
API Gateway
LiveSingle entry point for all clients that handles routing, authentication, rate limiting, and protocol translation.
Layered (N-Tier) Architecture
LiveOrganise code into horizontal layers (Presentation, Business Logic, Data Access) where each layer only calls the one below it.