Definition: Migration pattern that gradually replaces a monolithic system by redirecting functionalities one by one to the new system until the original becomes obsolete.
— Source: NERVICO, Product Development Consultancy
What Is the Strangler Fig Pattern
The strangler fig pattern is an incremental migration strategy that enables gradually replacing a legacy or monolithic system without requiring a complete rewrite. Inspired by the strangler fig tree that grows around a host tree until replacing it, this pattern progressively redirects functionalities from the old system to the new one, until the original system can be fully decommissioned.
How It Works
It is implemented in three repetitive phases. First, a specific functionality from the legacy system is identified for migration. Second, that functionality is implemented in the new system (typically microservices). Third, a proxy or facade is configured to redirect requests for that functionality to the new system while the rest of the traffic continues flowing to the monolith. This cycle repeats functionality by functionality. In each iteration, the monolith loses responsibilities and the new system gains coverage.
Key Use Cases
- Migrating monoliths to microservices architecture without interrupting production service
- Progressive modernization of legacy systems that cannot be stopped for a complete rewrite
- Gradual replacement of obsolete technologies while maintaining business operations during the transition
- Reducing migration risk by validating each migrated functionality independently
Advantages and Considerations
The strangler fig pattern drastically reduces risk compared to big-bang migrations, as each functionality is independently validated in production before migrating the next. It enables obtaining incremental value during the process rather than waiting for the complete migration to finish. The main consideration is that it requires maintaining two systems running simultaneously for an extended period, increasing operational costs and coordination complexity.