Cloud concept · Updated

Strangler Fig Pattern - The Strangler Fig Pattern incrementally replaces an existing application by routing selected capabilities to new implementations while the remaining functionality continues running in the legacy system.

In short

The pattern lets legacy and replacement implementations coexist while functionality moves across a controlled routing or integration boundary. It reduces the scope of individual migration steps and enables earlier delivery, but requires deliberate management of data ownership, compatibility, operational complexity, and eventual retirement of the old implementation.

Cloud Concepts Hub →

6 key aspects of Strangler Fig Pattern

The pattern combines incremental capability replacement, controlled coexistence, explicit data ownership, validated cutovers, and deliberate legacy retirement.

01
Incremental replacement by capability

Move a bounded business capability at a time while the remaining application continues operating. Select boundaries using dependency analysis, transaction requirements, and business value rather than code size alone.

02
Controlled interception and routing

Use a gateway, proxy, facade, or message boundary to direct work to the appropriate implementation. Keep routing rules observable and test their precedence so traffic does not accidentally reach the wrong backend.

03
Compatible coexistence

Preserve consumer-facing contracts while legacy and replacement implementations operate together. Adapters can translate interfaces and domain models, but identity, authorization, sessions, and failure semantics also need explicit handling.

04
Explicit data ownership

Define the authoritative writer for migrated data and plan synchronization, validation, and ownership transfer. Treat shared databases and replication as migration mechanisms with known coupling and consistency limits.

05
Measured rollout and recovery

Use contract tests, traffic segmentation, and business-level telemetry to validate each step. Confirm that rollback remains safe after data changes instead of assuming a routing reversal restores the previous state.

06
Planned legacy retirement

Attach removal criteria to each extracted capability, including unused code, data access, scheduled jobs, and infrastructure. The migration is incomplete while obsolete dependencies continue to impose operational cost or constrain changes.

Cloud services for Strangler Fig Pattern

API Gateway or Application Load Balancer can provide the request-routing boundary between legacy and replacement implementations; both are not required. Lambda can host suitable extracted capabilities or adapters, while other runtimes can serve larger or long-running components. AWS DMS can assist with supported database replication during data separation, and EventBridge can route business events to newly extracted consumers. These services supply routing, execution, replication, and integration mechanisms rather than an automatic modernization workflow. Engineers still define capability boundaries, preserve contracts, establish authoritative writers, validate cutovers, and remove obsolete components.

Amazon API GatewayAmazon API Gateway

Provides a stable API entry point with route or resource integrations targeting different backends. It can expose replacement functions or HTTP services alongside legacy HTTP integrations, subject to the chosen API type and connectivity configuration.

AWS LambdaAWS Lambda

Can host extracted capabilities or temporary translation adapters without requiring a dedicated application server. Function execution limits, concurrency, downstream capacity, and state management determine whether a capability fits this runtime.

Amazon EventBridgeAmazon EventBridge

Routes published events to replacement consumers, enabling selected integrations to move away from direct legacy calls. Producers must reliably publish events, and consumers must handle retries, duplicates, and applicable ordering requirements.

What is Strangler Fig Pattern

3 min read

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.