AlgoMaster Logo

Strangler Fig Pattern

Low Priority13 min readUpdated October 8, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Premium Video

This video is available to premium subscribers only

Unlock Full Access

Modernization almost always happens while the old system is still serving real users. You usually cannot switch it off and start over, and a full rewrite puts years of work and a huge amount of risk into one big launch.

The Strangler Fig pattern takes a safer path. The new system grows around the old one and takes over one piece at a time, while a routing layer decides which system handles each request. Eventually, the old system has nothing left to do and can be shut down.

This chapter covers what the Strangler Fig pattern is, how it helps teams replace a legacy system gradually instead of all at once, how traffic and data move from the old system to the new one, and the challenges that come with a long migration.

1. The Problem with Big-Bang Rewrites

Suppose a company runs an e-commerce platform built as one large monolith. It is ten years old and handles products, carts, orders, payments, and user accounts in a single codebase.

Over time, the system has become difficult to change. Deployments are slow and risky, and a bug in one area can affect the entire site. So the team decides to move to a new architecture.

One option is a complete rewrite. The team builds the new system from scratch and then switches over on a single day. This is often called a big-bang rewrite, and it comes with serious risks.

  • It takes years, and the business keeps moving. A full rewrite can take years, and during that time the business still needs new features. Those features either have to be built twice, once in the old system and once in the new one, or the new system gradually falls behind.
  • Hidden rules. The legacy system contains years of small rules and edge cases that may no longer be documented. Some are only discovered when the new system behaves differently.
  • One big switchover. Eventually, everything depends on one large switchover. If something goes wrong, every user can be affected at once.

This is why large rewrites are often much harder than they first appear.

2. Where the Name Comes From

The Strangler Fig pattern takes a different approach. Martin Fowler named it in 2004 after strangler fig trees he saw in the rainforests of Queensland, Australia.

A strangler fig begins as a seed high in the branches of another tree. It sends roots down toward the ground and gradually grows around the host. Over time, the fig becomes larger while the original tree declines. Eventually, the host dies and the fig stands on its own in roughly the same place.

There is no point where the old tree is suddenly removed and replaced.

That is the idea behind the pattern. The new system gradually grows around the old one, taking over one piece at a time until the legacy system is no longer needed.

Premium Content

This content is for premium members only.