Strangler Fig Pattern in System Design

Replace a legacy system in useful, controlled slices

One entrance, gradually changing ownership

Existing callersPreserve or version the agreed contract
Migration facadeRoute a controlled capability slice
Legacy pathRemaining capabilities and compatible data
Replacement pathMigrated capability with explicit ownership
A facade sends selected routes to a new implementation and others to legacy. Shared data, background jobs and rollback determine whether the transition is safe.

An old application still serves customers, but one part needs a new implementation. Replacing everything at once can make it difficult to compare behaviour, recover from mistakes and keep the service running.

The strangler fig pattern gradually routes selected responsibilities to a replacement while the legacy system continues serving the rest. A facade or router can control that boundary. It is a migration strategy, not a promise that every old application can be split easily.

What you’ll learn

  • Choose a bounded capability to migrate first.
  • Plan routing, authoritative writes and rollback together.
  • Define evidence for removing the old implementation safely.

Pick a slice with clear boundaries

Start from a capability and its dependencies. A public catalogue read may be easier to isolate than a payment operation touching several shared tables. Identify callers, data writes, scheduled jobs and external effects before moving traffic.

The new implementation needs an agreed contract. Preserve important request and response behaviour, permissions and error semantics, or deliberately version the interface for callers.

Small increments make observation and recovery easier, but an increment must still be coherent. Moving an endpoint without its data rules can leave two implementations disagreeing about ownership.

Choose cutover and rollback rules

Explore the design choices

You want to compare a new catalogue read before broad cutover.
Both implementations could write stock counts.

Compare the visible consequences. With JavaScript enabled, choose an option in each scenario to assemble your decision record.

This is an exploratory design exercise. It does not run infrastructure, measure capacity or replace the lesson’s quiz.

Every option and consequence stays visible. Choose an option in each situation to build a revisable decision record.

A new catalogue service is ready for limited read traffic. Later, the team wants to move stock updates. Select a plan for each transition.

The exercise records a proposed decision. Real migration requires representative tests, data checks and a concrete rollback procedure.

The data transition is part of the migration

Moving reads and moving writes have different risks. A read copy needs a freshness and validation rule. A new authoritative writer needs a plan for old callers, background jobs and recovery.

Dual writes can fail between destinations. Change-data capture, an outbox, or a product-supported migration mechanism may help particular flows, but each needs ordering, duplicates and reconciliation rules.

Compatibility can require additive schema changes and a staged rollout. If the replacement writes data the legacy code cannot understand, flipping traffic back is not a complete rollback.

Compare behaviour before removing the old path

Define cutover checks: representative successful responses, authorization, failure outcomes, latency, data agreement and external effects. A shadow read can compare responses, but do not blindly shadow writes that charge, email or create duplicate actions.

Monitor route ownership and remaining legacy callers. Remove old code only after dependencies and background work are accounted for. The migration facade itself needs capacity, availability and understandable configuration.

AWS strangler fig guidance describes gradual replacement through a routing boundary. Source checked 6 October 2026. The pattern adds a transition period where both implementations must be operated.

Check your design decision

A new implementation writes a schema the legacy code cannot read. Is switching the router back enough to prove rollback is safe?
Choose one answer. You can try again.

Answer and explanation

No. Data and interface compatibility must also be addressed.

Routing does not undo incompatible writes or external effects.

Check your design decision

Why avoid blindly replaying production writes into both implementations?
Choose one answer. You can try again.

Answer and explanation

The second path may repeat payments, messages or other business effects.

Shadowing needs explicit isolation and effect rules.

Use translation and compatibility during migration

Compare the Anti-Corruption Layer for business-model translation and Adapter for a narrower interface mismatch. Facade can give callers a stable subsystem operation while responsibilities move.

Move responsibility with its data and recovery rules

Gradual replacement can reduce cutover risk when slices have clear contracts. Track ownership, dependencies and evidence for each step.

Plan data migration and rollback alongside routing. Finish by verifying remaining callers and retiring the old path deliberately.

Reaching the recap and completing the quizzes are separate milestones.

    Next lesson: Choosing Design Patterns →