Architecture

The Strangler Fig Pattern for Legacy Modernization

How the Strangler Fig pattern replaces a legacy system one piece at a time behind a facade, when it fits, when it does not, and how to plan the first slice.

By Devacon LtdPublished 5 min read

Every organization has a system it is afraid to touch. It runs the business, it was built on tools that are now hard to hire for, and every change takes longer than the last. The tempting answer is a full rewrite: build the new system alongside, then switch over in one weekend. The trouble is that big-bang replacements take a long time, and the old system keeps changing while you build.

The Strangler Fig pattern offers a different route. Instead of replacing the whole system at once, you replace it one piece at a time, with both systems running side by side until the old one has nothing left to do.

Where the name comes from

Martin Fowler named the approach after strangler figs he saw in the rain forests of Queensland, Australia, in 2001. These plants grow around a host tree, draw on it as they grow, and can eventually stand on their own after the host is gone. Fowler originally called his article “Strangler Application” and later retitled it “Strangler Fig Application”, in part to restore the botanical reference.

His central argument is that gradually building new functionality around the edges of a legacy system, and moving behavior over in stages, is less risky than a wholesale replacement. Large rewrites tend to take a long time and to miss behavior the old system performs implicitly.

How the pattern works

Microsoft’s Azure Architecture Center describes the pattern in four phases, built around a facade, a proxy that sits between clients and the systems behind it:

  1. Introduce the facade. All client requests go through it. At first, it routes almost everything to the legacy system.
  2. Shift functionality incrementally. Each iteration implements another piece of functionality in the new system, and the facade routes those requests to it. The legacy system’s responsibilities shrink with every step.
  3. Decommission the legacy system. Once all functionality has moved and nothing depends on the old system, it can be switched off. The facade now routes everything to the new system.
  4. Remove the facade. Clients talk directly to the new system, which marks the end of the migration. Microsoft notes that you may instead keep the facade as an adapter for legacy clients.

Throughout, clients keep using the same interface and need not know a migration is happening.

When to use it

Microsoft suggests the pattern when you are gradually moving a back-end application to a new architecture, especially where replacing large systems or complex features in one go would be risky, and where the original system can keep running for an extended period.

It is a poor fit, according to the same guidance, when:

  • Requests to the back end cannot be intercepted, so there is nowhere to place a facade.
  • You cannot change the legacy system at all, through its code or another integration point such as its database.
  • The system is small and replacing it outright is simple.
  • The old system must be decommissioned quickly.

Design considerations

The pattern looks simple on a whiteboard. These are the details that decide whether it works.

The facade itself

Microsoft cautions that the facade must keep up with the migration and must not become a single point of failure or a performance bottleneck. In practice, it is often an API gateway, a reverse proxy or a routing layer in the application. Treat it as production infrastructure: monitor it, scale it and test its failover.

Shared data

Both systems often need the same data during the transition. Microsoft advises planning how services and data stores used by both systems will be accessed at the same time. Its example for a monolithic database moves one domain at a time:

  1. The new service handles requests for its domain but still reads and writes the shared legacy database.
  2. A separate domain database is introduced, loaded with an extract, transform and load process and kept in sync with change data capture. Consistency is validated before cutover.
  3. The new domain database becomes the system of record, and the domain’s tables and procedures are removed from the legacy database.

Microsoft notes that rollback to the legacy database stays possible until those legacy objects are removed, and recommends treating that removal as a deliberate final step for each domain.

Calls in both directions

During migration, the new system may need functionality that has not moved yet, and the legacy system may need functionality that already has. Microsoft recommends an anti-corruption layer, an adapter that translates between the two, so the new design does not inherit legacy conventions.

Transitional code

Fowler describes the temporary code that lets old and new coexist as transitional architecture. It costs effort and is thrown away at the end, but it is what keeps each step small and safe. Budget for it explicitly rather than treating it as waste.

Planning the first slice

Choosing the first piece to move sets the tone for the whole program. Good candidates are:

  • Valuable but bounded. Users notice the improvement, but the slice has clear edges.
  • Easy to route. Requests for it can be identified at the facade by URL, message type or operation.
  • Light on shared data, or with data that can be separated cleanly.
  • Well understood. Someone can explain what the old code really does, including the edge cases.

Avoid starting with the most tangled core component. Early slices are for proving the facade, the deployment pipeline and the data synchronization approach.

A modernization checklist

  • Map the system: features, interfaces, data stores and the teams that depend on each.
  • Define service boundaries for the new system before moving anything.
  • Put the facade in place and route all traffic through it before migrating the first feature.
  • Capture current behavior with characterization tests, so you know the new slice does what the old one did.
  • Plan data ownership per slice: who writes, who reads, how it is synchronized and how to roll back.
  • Release each slice gradually, with the ability to route traffic back to the legacy path.
  • Remove legacy code and data for each completed slice, so the old system genuinely shrinks.
  • Track progress by retired functionality, not just by new features built.

Common pitfalls

  • Never finishing. If old paths are not removed, you end up running two systems indefinitely.
  • Copying legacy design into the new system through shared tables and direct calls, instead of using a translation layer.
  • Ignoring the organization. Fowler highlights that modernization also means changing how teams work; new architecture with old processes recreates old problems.

How Devacon can help

We modernize legacy applications incrementally, including facade and routing design, characterization tests, data migration with synchronization, and the removal of retired code. A typical engagement starts with a system map and a first slice chosen to prove the approach, then continues slice by slice. Learn more about our legacy modernization services.

Sources

  1. Microsoft Azure Architecture Center: Strangler Fig pattern
  2. Martin Fowler: Strangler Fig Application

Facts in this article were checked against the sources above on November 17, 2026. Standards and products change, so check the source before relying on a detail. Related service: Legacy Modernization.

More insights

Let's build something great together

Ready to talk about custom software? Tell us about your project requirements and we will get back to you.