All laws

§ 90Maintainability

Strangler Fig

Replacing a live system piece by piece around its edges is usually safer than replacing it all at once.

Martin Fowler

Keep in mind

Make every step of a migration shippable, and plan the deletion up front

What to do

Put an interception point (a proxy, router or facade) in front of the legacy system and move one slice of behavior behind it at a time, starting with one that delivers value on its own. Define "done" at the start, track the share of traffic still on the old path, and budget deleting the old code and the transitional layer as part of the project, not as cleanup for later.

Why it happens

A complete rewrite has to reproduce years of behavior nobody wrote down, while users keep needing features the old system must still deliver, so the target moves while the new system is not yet usable. Nothing reaches production until the end, so the risk and the value both land on a cutover day that often never comes. Routing one capability at a time to new code keeps each step small enough to verify and roll back, and each step starts paying back as soon as it lands. The price is transitional architecture: interception layers and adapters built to be thrown away.

When it stops applying

Clean Cutover: when the old system cannot be intercepted cleanly, or the transitional layer would cost more than the rewrite, a single planned switch avoids the common end state of incremental migration: the easy routes move, the tangled core never does, and the organization runs and pays for two systems indefinitely.

Source

Martin Fowler, Strangler Fig Application (martinfowler.com; originally "Strangler Application", 2004; rewritten 2024) — the fig metaphor and the case that the reduced risk and earlier value of gradual modernization outweigh the cost of transitional architecture.

Read the source

Portrait: Ade Oshineye, CC BY 2.0 · Wikimedia Commons

Cite this

Hammurabi, § 90, “Strangler Fig.” https://kanywst.github.io/hammurabi/laws/strangler-fig/

BibTeX
@misc{hammurabi-strangler-fig,
  title  = {Strangler Fig},
  author = {{Hammurabi contributors}},
  note   = {Hammurabi, § 90},
  url    = {https://kanywst.github.io/hammurabi/laws/strangler-fig/}
}

Text under CC BY-SA 4.0: credit Hammurabi and link the article.

Read in a column

Related laws

Suggest a correction on GitHub