The strangler fig pattern: modernising legacy systems step by step

An old block partly enclosed by a growing lattice of new blocks, with the new lattice in blue

How to replace an old system piece by piece while the business keeps running, and when the approach is the wrong choice.

In short

The strangler fig pattern is a way to replace a legacy system gradually. A facade routes each request either to the old system or to new components, and functionality moves across one piece at a time until the old system can be switched off. It reduces the risk of a big-bang rewrite, at the cost of running temporary transitional code.

Most companies that depend on an old system know the dilemma: the system is too important to stop and too costly to keep extending. Legacy modernisation (legacy modernisering) through a full rewrite often takes years and fails to deliver, because users cannot wait that long for new features. This explainer is written by Devies, a Gothenburg-based product and engineering consultancy, for CTOs, architects and IT managers who need a safer route. It defines the strangler fig pattern, separates it from similar approaches, walks through how it works in practice, and explains when it does not fit.

What is the strangler fig pattern?

The strangler fig pattern is an incremental modernisation approach in which new components gradually take over the functions of a legacy system until the old system can be decommissioned. Users keep using the same interface and do not notice that a migration is in progress.

Martin Fowler named it after strangler figs he saw in the Queensland rain forest in 2001: vines that grow around a host tree and eventually stand on their own. In his updated article from 2024, he notes that the term is now often used for any gradual approach to legacy modernisation, and that the original name, "Strangler Application", was changed to "Strangler Fig Application".

Four terms make the pattern concrete:

  • A facade is a routing layer, often a proxy or API gateway, that sits in front of the old system and decides whether each request goes to the legacy code or to a new component.
  • A seam is a place where the system can be split, such as a clear module, an API or a distinct business capability.
  • Transitional architecture is temporary code that lets old and new systems coexist, and that will be removed when the modernisation is complete.
  • An anti-corruption layer is an adapter that translates between the old and new systems, so that legacy concepts do not leak into the new design.
Four panels showing a router in front of an old and a new block, with traffic shifting from old to new, the new block in blue

Microsoft's Strangler Fig pattern guidance describes the lifecycle in four phases: introduce the facade, shift requests to the new system piece by piece, decommission the legacy system once nothing depends on it, and finally remove the facade or keep it as an adapter for older clients.

How is it different from a rewrite or a refactor?

The strangler fig pattern differs from a rewrite because it delivers value continuously, and from a refactor because it replaces the old system rather than improving it in place. Leaders often treat these options as interchangeable; they are not.

Approach

What happens

Value delivered

Main risk

Strangler fig pattern

What happens

New components replace old functions one by one behind a facade

Value delivered

After every migrated slice

Main risk

Transitional code and running two systems for a period

Big-bang rewrite

What happens

A new system is built beside the old one and switched on at once

Value delivered

Only at the end

Main risk

Long delay, missed behaviour, failed cut-over

Refactoring in place

What happens

The existing code is restructured without changing behaviour

Value delivered

Gradually, inside the old system

Main risk

The underlying platform and its limits remain

Rehost (lift and shift)

What happens

The system moves unchanged to new infrastructure

Value delivered

Infrastructure benefits only

Main risk

All existing code problems move with it

These approaches can also be combined. A company might rehost a legacy system to the cloud first, then strangle it gradually; our guide to cloud migration strategy covers that choice per application. Refactoring the old code to create cleaner seams often makes strangling easier.

If you are still deciding whether to modernise at all, start with our article on technical debt as a business risk, which covers the symptoms and the business case. This explainer assumes you have decided and want to know how.

How does a strangler fig migration work in practice?

A strangler fig migration works as a repeated cycle: pick a slice, build it new, route traffic to it, move its data, and remove the old code. Each cycle should be small enough to finish in weeks, not quarters.

Fowler, drawing on the work of Ian Cartwright, Rob Horn and James Lewis, describes four activities that run in parallel rather than in sequence: understand the outcomes you want, break the problem into smaller parts, deliver those parts, and change the organisation so the new way of working lasts. In day-to-day terms, a cycle looks like this:

  1. Choose the slice. Start with a capability that has a clear seam and real business value, such as a new feature that can be built beside the legacy system, or a module that changes often and hurts the most.
  2. Put the facade in place. Route all traffic through it, initially sending everything to the legacy system. This step alone is worth testing carefully, because the facade must not become a bottleneck or a single point of failure.
  3. Build the new component. Protect it from legacy concepts with an anti-corruption layer where the two systems must talk.
  4. Move the data. Microsoft's guidance suggests copying the domain's tables to a new database with an initial load, keeping them in sync with change data capture, validating consistency, and only then making the new database the system of record.
  5. Shift traffic gradually. Route a share of requests, or a group of users, to the new component, and compare results with the old system.
  6. Remove the old code. Delete the legacy functions and data for that slice once the new component is proven. Until then, keep a rollback path.

Automated tests are what make each cycle safe. Characterisation tests that pin down the old system's actual behaviour are particularly valuable; our guide to a test automation strategy covers how to build them into the pipeline.

When does the strangler fig pattern not fit?

The strangler fig pattern does not fit when requests to the old system cannot be intercepted, when the system is small enough to replace at once, or when the old system must disappear quickly. In those cases, its overhead outweighs its benefits.

Microsoft lists four situations where the pattern may be unsuitable: requests to the backend cannot be intercepted; you cannot access the legacy source code and it has no other changeable integration point, such as its database; the system is small and replacing it whole is simple; or you need to decommission the original solution quickly.

Two further warnings come from experience. First, the pattern needs organisational change as well as technical change. Fowler points out that if the organisation's design thinking and processes stay the same, the new system risks becoming a similar mess. Second, the migration must actually finish. Many companies strangle the easy half of a system and then run two systems for years. Set a target date for decommissioning, track the share of traffic and functions still on the old system, and make it visible to leadership.

Finally, be careful about what the new components become. Replacing a monolith with dozens of small services is not automatically progress; our comparison of microservices and a monolith explains when a well-structured single application is the better target.

Devies

Want a second opinion?

Devies, a Gothenburg-based product and engineering consultancy, works on questions like this with Nordic product and IT teams. Tell us where you are and we will suggest a sensible first step.

Talk to Devies

Frequently asked questions

Why is it called the strangler fig pattern?

Martin Fowler named it after strangler figs he saw in Queensland, Australia, in 2001. These vines grow on a host tree, gradually surround it, and eventually stand on their own. The software pattern works the same way: new components grow around an old system and take over its functions until it can be removed. The original name, "Strangler Application", was later changed to "Strangler Fig Application".

How long does a strangler fig migration take?

It depends on the size of the legacy system and how many seams it has. Each slice should take weeks rather than months, so that value and learning arrive early. Replacing a large business-critical system completely often takes one to several years. The advantage over a rewrite is that every slice delivers value along the way, so the business is not waiting for a single launch date.

What is the difference between the strangler fig pattern and a rewrite?

A rewrite builds a complete new system beside the old one and switches over at once, so value arrives only at the end and the cut-over carries high risk. The strangler fig pattern replaces the old system piece by piece behind a facade. Users keep working throughout, each migrated piece delivers value immediately, and problems surface early when they are still cheap to fix.

Does the strangler fig pattern require microservices?

No. The new components can be services, a new modular application or even a SaaS product that takes over a function. The pattern is about replacing functionality gradually behind a stable interface, not about a specific target architecture. Many teams find that a well-structured modular application is a simpler and cheaper target than a large number of small services.

Sources

Here’s more

Join Our Newsletter

We handle your data according to our privacy policy.

Shopping Cart

We use cookies

We use cookies to improve your experience on this website. You may choose which types of cookies to allow and change your preferences at any time. Disabling cookies may impact your experience on this website. You can learn more by viewing our Cookie Policy.

Check out

Contact Form text

We will contact you text

We handle your data according to our privacy policy.