Strangler Pattern - Replacing Old Systems Step by Step

The strangler pattern (strangler fig pattern) is an approach to gradually replace an old system with a new one while it keeps running. New components take over individual functions one by one; the old system "withers" until it can be shut down. The big advantage over a big-bang rebuild: low risk, continuous benefit, and a working system at all times. The term goes back to Martin Fowler.

Category:Software Development

The strangler pattern (strangler fig pattern) is a proven approach to gradually replace an old system with a new one without shutting it down. The term was coined by Martin Fowler and refers to the strangler fig: this plant grows around a tree, gradually taking over its structure until the original tree is no longer needed.

The Principle

Applied to software this means: you do not build the new system next to the old one only to replace it in one big cutover. Instead, you place a redirection layer (often an API gateway or a proxy) in front of the old system. Every request first continues into the old system. One by one, individual functional areas are rebuilt, and the redirection sends the relevant requests to the new component. With each step the new system takes over more, the old system "withers", until in the end it can be shut down completely.

  1. Introduce redirection: A layer in front of the old system routes requests deliberately.
  2. Rebuild a function: A bounded area is implemented as a new component.
  3. Switch over: The redirection sends this area to the new component, the rest stays with the old system for now.
  4. Repeat: Area by area migrates until the old system is empty.
  5. Shut down: The hollowed-out old system is decommissioned.

Advantages over the Big Bang

A complete rebuild during ongoing operations ("big bang") often develops the new system in secret for years and then switches over at a risky moment. The strangler pattern avoids exactly these risks:

  • Low risk: Every step is small and testable on its own; if something goes wrong, only a small area is affected.
  • Continuous benefit: Improvements go into production continuously instead of only after years.
  • Always operational: The overall system works at all times because old and new run in parallel.
  • Reversible: Individual switch-overs can be rolled back without endangering the whole project.

Risks and Prerequisites

The pattern is not a sure-fire success. The redirection layer must be reliable, otherwise it becomes a bottleneck itself. During the transition, old and new often access the same data, which requires careful coordination. And the phase in which both systems run in parallel temporarily causes double operational effort. Automated tests are the safety net here too, securing every switch-over step.

The strangler pattern is thus one of the most important techniques of legacy modernization and a frequent building block on the refactor path of application modernization. At the same time it helps to reduce accumulated technical debt in a targeted way and without a total outage.

Strangler Pattern at Elasticbrains

At Elasticbrains we use the strangler pattern to retire old systems with low risk and during ongoing operations. We carve out sensible functional areas, secure them with tests, and switch them over to the new components in a controlled way - step by step, until the old system can be shut down. Learn more on our legacy modernization page.

More Glossary Terms