SOLID & Design Patterns Interview Question #122
What is the Strangler Fig Pattern?
Architectural Patterns, Application Boundaries & Distributed Design Patterns Senior Advanced
Quick Interview Answer
The Strangler Fig Pattern incrementally replaces a legacy system by routing selected functionality to new components while the old system continues to serve the remaining functionality.
Detailed Explanation
The Strangler Fig Pattern incrementally replaces a legacy system by routing selected functionality to new components while the old system continues to serve the remaining functionality.
Over time, more capabilities move to the new implementation until the legacy component can be retired. This reduces the risk of a single large rewrite and supports gradual migration.
Code Example
Client
|
Routing Layer
|------> Legacy Module
|
|------> New Module
// Move routes incrementally to New Module.