The strangler fig: migrating legacy systems without a freeze
Big-bang rewrites fail for structural reasons, not technical ones. A field guide to incremental extraction from systems that cannot go offline.
The strangler fig pattern is named after a vine that grows around a host tree, gradually taking over its structure until the original rots away and the fig stands on its own. Applied to software, it means routing traffic through a facade, replacing one capability at a time behind it, and retiring the legacy system only when nothing calls it any more. No freeze, no flag day, no weekend everyone dreads.
Why big-bang rewrites fail
The rewrite fails for structural reasons, not technical ones. The old system keeps changing while you rebuild, so you are aiming at a moving target. The new system delivers no value until the day it is switched on, so it is the first thing cut when timelines slip. And the knowledge encoded in a decade of bug fixes lives only in the code you are throwing away.
Incremental extraction inverts all three. The target stops moving one slice at a time, value ships continuously, and each slice forces you to understand the behaviour before you replace it.
Step one: put a facade in front
Every request to the legacy system now passes through a routing layer you control, an API gateway, a reverse proxy, or a thin service. On day one it forwards everything straight through and changes nothing.
This facade is the seam. It is where you will later say "these routes go to the new service, everything else stays." Getting it in place with zero behaviour change is the whole first milestone, and it is worth doing carefully because everything else depends on it.
Choosing the first slice
The first capability to extract should be valuable enough to justify the work, isolated enough to carve out cleanly, and low enough risk that a mistake is recoverable. Reporting and read-only views are common starting points: they have few writes to reconcile and a clear boundary.
Avoid starting with the most tangled part of the system. You want the first extraction to build confidence and prove the pattern, not to be the hardest thing you will ever do.
Handling shared data
The hardest part is rarely the code, it is the database both systems still need. Options, roughly in order of preference: have the new service call the old one for the data it needs; replicate the relevant tables with change-data-capture so the new service reads its own copy; or, once writes have moved, let the new service own the data and expose it back to the legacy system through an API.
Pick the smallest step that unblocks the current slice. You do not need the final data architecture on day one; you need the next slice shipped.
Knowing when a slice is done
A slice is done when the facade routes that capability to the new service, the old code path is disabled (not yet deleted), and monitoring shows the new path handling real traffic at the expected error and latency rates.
Leave the old code in place, dark, for a release or two. If something was missed, re-enabling the old path is a config change, not an incident.
Retiring the host tree
After each slice, check what still calls the legacy system. When the list reaches zero, the old system can be switched off, and by then it is an anticlimax, because no traffic has touched it for weeks.
The migration takes longer in calendar time than a rewrite plan claims it will. It also finishes, which rewrite plans frequently do not.