Skip to content
GabineteTools for thinking

No. 1509Workflow and delivery

Strangler Fig Pattern

Martin Fowler · 2004

A brass comb diverts almost all the threads towards a green network that wraps a hollow grey box; there is only one grey thread left.

The table / Model card · No. 1509 · Workflow and delivery

Strangler Fig Pattern

A way to replace a legacy system gradually by routing functions one at a time to a new system until the old one can be switched off.

The essentials

What it is

What it solves

How do you replace a critical legacy system without a big-bang rewrite and its risk of failure?

When to use it

Use it when the legacy system must stay in operation, when a full rewrite would take years, or when functionality can be separated into slices. It suits web and service-based systems with a clear interface.

Where it comes from

Martin Fowler, a British software author at ThoughtWorks, described the idea in 2004 under the name 'StranglerApplication', after seeing strangler figs in Australian rainforest. He proposed replacing a legacy system gradually instead of through a risky rewrite.

Martin Fowler · 2004

How it works

A routing layer (a facade or proxy) is placed in front of the legacy system. Individual features are rebuilt in the new system, and the router sends the relevant traffic there while the rest continues to go to the old system. Each migrated slice is in production and can be rolled back by changing the routing. When no traffic goes to the legacy system, it is retired.

You need

Knowledge of legacy functions and data, a place to put a routing layer, a prioritised list of slices, and automated tests for current behaviour.

You get

A running new system that grows slice by slice, a routing layer, and a plan and date for decommissioning the legacy system.

Case

Illustrative case

Orbis Bank has a 20-year-old loan application system in COBOL. The team places an API gateway in front of it. First slice: the credit-score check is rebuilt as a new service, and the gateway routes 10 percent of requests, then 100 percent after parity checks. Next slices: document upload, then customer notifications. Data is synchronised both ways during the transition. After 22 months only the batch settlement runs on the mainframe, and it is moved last. Each step is reversible by a gateway setting.

A fictional company used to explain the model.

Caution

When to avoid it

  • Not suitable when there is no interception point, for example a tightly coupled embedded system.
  • Not worth it for small systems that can be rewritten in a few weeks.

Common mistakes

  • Leaving the last 10 percent of legacy features in place indefinitely.
  • Forgetting to plan data migration and synchronisation.
  • Building the new system without tests for existing behaviour.
  • Allowing the routing layer to become a new monolith.

Known weaknesses

  • Two systems must be run and synchronised for a long time
  • Needs a clean interception point, which many legacy systems lack
  • Data migration is the hardest part and is often underestimated
  • Can stall with the last legacy components left running

How to apply it in 6 steps

How to apply it

Strangler Fig Pattern

6 steps

Use the arrow keys to move between steps, Home and End for the first and last, and Enter to fold or unfold the booklet.

View all 6 steps
  1. Assess the legacy system

    Map its functions, data and interfaces, and find natural slices.

  2. Place a routing layer

    Introduce a facade or proxy in front of the legacy system without changing behaviour.

  3. Rebuild one slice

    Build one function in the new system with tests that match legacy behaviour.

  4. Redirect traffic

    Route the slice's requests to the new system, with the option to switch back.

  5. Repeat by priority

    Migrate slice after slice, including data, as the legacy part shrinks.

  6. Decommission

    Switch off the legacy system once no traffic or data depends on it.

Which decisions it helps with

Decision profile

A phased process to take action on a product or service.

Keyboard: Tab to the sheet, use the arrows to explore the assessments and their questions, and press Escape to close the note.

IIdentity

Type of tool
Phased process
Decision stage
Plan the work, roles and deadlines
What it applies to
A product or service
Discipline
Agile and software development
What it produces
A sequence of phases completed in order

IIIResources required

  • TimeWeeks or months
  • PeopleA small group (2 to 8)
  • DataA few readily available facts
  • ExpertiseWorks best with a facilitator
  • Time horizonOne to three years
  • ScopeBetween “one team” and “a unit or department”
  • FrequencyOccasionally
The team’s own knowledge is enough

IITen axes

The dot shows which end the model favours. A hollow dot means no clear preference.

  • DirectionExecution
  • Top-downmixedBottom-up
  • PeopleProcesses
  • Generate optionsNarrow down options
  • Step-by-step analysisIntuition and experience
  • A strict sequence of stepsA flexible framework
  • Protect what we haveTake a risk
  • Improve what we haveFundamental change
  • Inside the organisationOutside the organisation
  • Understand firstAct now

IVUseful when

Applicable traits

  • How it supports actionDecide what comes first
  • Product stageGrowing an existing product
How was this profile calculated?

An automated system reads each model card and answers the same questions for every model. This profile has answers for 77 of 77. No answers are entered by hand.

A very high probability counts as “yes” and a very low one as “no”. Intermediate answers are hidden.

On the axes, mixed means the model favours neither end.

How it works →

Thinking space

Workflow and delivery

They organize and accelerate day-to-day delivery: Kanban, DevOps, development cycles, automation and work standards.

Membership: 25 % · also “Product discovery and validation” (20 %)

View in the atlas of spaces →

Each point is a model. Distance reflects answers to the decision questions. Light points share this model’s space.

Similar models

Verified sources

Use the arrow keys to move between sources.

Original work

  1. Fowler, M. (2004). StranglerApplication. martinfowler.com bliki.Archived bliki page dated 29 June 2004 that introduces the strangler vine metaphor from Australian rainforest and gradual replacement of a legacy system.View source: StranglerApplication (opens in a new tab) ↗

Key development

  1. Newman, S. (2019). Monolith to Microservices. O'Reilly Media.Book-length practitioner treatment of incremental migration; chapter 3 includes 'Pattern: Strangler Fig Applications'.View source: Monolith to Microservices (opens in a new tab) ↗
  2. Li, C., Ma, S. and Lu, T. (2020). Microservice Migration Using Strangler Fig Pattern: A Case Study on the Green Button System. 2020 International Computer Symposium (ICS), 519-524.Academic case study applying the Strangler Fig pattern with Domain-Driven Design to migrate a monolith, with quantitative performance measurements during the migration; notes that a complete, systematic migration process was still lacking.View source: Microservice Migration Using Strangler Fig Pattern: A Case Study on the Green Button System (opens in a new tab) ↗
  3. Fowler, M. (2024). Strangler Fig. martinfowler.com bliki.Fowler's 22 Aug 2024 revision renames the pattern 'Strangler Fig' and recounts the 2001 Queensland rainforest origin of the metaphor.View source: Strangler Fig (opens in a new tab) ↗

The catalogue does not yet list a published critique of this specific model.

Wikipedia article (opens in a new tab) ↗