The Strangler Fig Pattern is an incremental application replacement strategy. Instead of rewriting an entire system and switching everything at once, engineers implement selected business capabilities separately and redirect their consumers to the new implementation. The legacy application continues serving capabilities that have not yet moved. Over successive migrations, the replacement takes over the intended scope and the corresponding legacy components are retired.
A common starting point is an interception layer in front of the existing application, such as an API gateway, reverse proxy, or application load balancer. Initially, it forwards requests to the legacy application. As replacement capabilities become ready, routing rules send selected paths, operations, or customer cohorts to them. Not every implementation requires an external proxy: an internal facade, message consumer boundary, or application-level dispatch mechanism can provide the same separation when external requests do not expose suitable boundaries.
For example, an online retailer might move product search out of a monolithic application first. Requests for search go to a new service, while checkout and account management remain in the monolith. Later, the team extracts order tracking and then selected checkout functions. Existing client contracts can remain stable while adapters translate between the legacy interfaces and the new domain model. Authentication, authorization, error responses, and session behavior must remain compatible across both implementations.
Choose migration units around coherent business capabilities and their dependencies rather than arbitrary code modules. A capability with clear interfaces, measurable outcomes, and limited coupling is usually easier to extract than a function that shares transactions and mutable state throughout the application. The replacement can run in containers, virtual machines, managed application platforms, or serverless functions. Microservices and serverless computing are possible implementation choices, not requirements of the pattern.
Data migration is often harder than request routing. Establish which implementation owns writes for each migrated capability and how other components obtain that data. A temporary shared database can simplify early steps, but it preserves schema coupling and can obstruct independent deployment. Separating databases may require an initial copy followed by change data capture, reconciliation, and a controlled transfer of write ownership. Replication lag and eventual consistency must be acceptable to the business workflow. Avoid assuming that independent writes to two databases are atomic; use explicit consistency and recovery mechanisms where necessary.
Validate each migration step with contract tests, production-like integration tests, and telemetry that distinguishes legacy and replacement traffic. Shadow requests can compare read behavior, but duplicated requests must not trigger payments, notifications, or other side effects. Where routing supports it, introduce traffic gradually and monitor latency, errors, and business outcomes before expanding exposure. Routing rollback is useful only when the old implementation can still interpret the current data and state. A new schema or transferred write authority can make rollback require synchronization or a forward repair rather than a simple routing change.
The principal trade-off is reduced cutover scope in exchange for a period of operating two systems and their integration mechanisms. Additional network hops, duplicated infrastructure, security boundaries, and distributed failure modes can increase cost and operational work. Design the routing layer for availability, configure bounded timeouts, and avoid fallback behavior that could repeat non-idempotent operations. Incremental delivery does not automatically improve resilience if every new service still depends synchronously on the same fragile legacy component.
This pattern is not merely a canary release or a lift-and-shift migration. Canary releases control exposure to a release; strangler migrations progressively replace application responsibilities, potentially using canaries within each step. Define completion criteria for every capability, remove obsolete routes and dependencies, archive or migrate required records, and shut down unused infrastructure. Without explicit retirement work, the temporary coexistence architecture can become a permanent source of complexity.