Insights · Modernization
The strangler fig pattern: modernize without a big-bang rewrite
Replace legacy incrementally behind a routing facade: grow the new alongside it, divert traffic piece by piece, then retire the old.
Martin Fowler borrowed the metaphor from the fig vines of Asia: the seed germinates in the upper branches of a host tree, grows downward, and gradually strangles the host until it stands alone. In the 2004 bliki he connected it to legacy modernization, and the current Strangler Fig Application entry keeps the argument sharp: “big bang” replacements usually fail because they take too long, users can’t wait for new features, and by the time the replacement arrives, the requirements have moved. The strangler approach inverts the risk curve: “it begins with small additions, often new features, that are built on top of, yet” separate from the legacy system — and since those components are small, “there isn’t so much risk involved when we introduce the new software.”
The mechanics: four phases behind a façade
Microsoft’s Azure Architecture Center treatment is the most operational description of the mechanics, and it matches what works in the field:
- Intercept. Introduce a façade (a proxy, gateway, or ingress rules) between clients and the legacy system. Clients are unaware a migration exists.
- Divert incrementally. Move specific pieces of functionality to new services, with the façade routing an ever-larger share of requests to them. Each iteration is small and reversible.
- Decommission. When no dependencies on the legacy functionality remain, retire it and route all requests to the new system.
- Remove the façade. Clients talk to the new system directly. The façade was transitional architecture — Azure’s phrase — and its cost is temporary by design.
Azure’s “when to use / when not” list is the honest scope check. Use it when you’re gradually replacing a large or risky system and the original can coexist for an extended period. Don’t use it when requests can’t be intercepted, when the legacy system has no integration point you can change, when the system is small enough that wholesale replacement is simple, or when you need the legacy system gone quickly. The strangler fig is a strategy for large systems with a pulse, not for every migration.
Where to cut: four activities, not one
Cartwright, Horn and Lewis — the Thoughtworks team behind Patterns of Legacy Displacement — define four activities that make displacement succeed, done iteratively: “Understand the outcomes you want to achieve”; “Decide how to break the problem up into smaller parts”; “Successfully deliver the parts”; and “Change the organization to allow this to happen on an ongoing basis.” The second is where most programs fail: they cut along technical convenience instead of along seams the business can absorb. Their pattern catalogue supplies the tools for each activity — Event Interception (“intercept any updates to system state and route some of them to a new component”) to create a technical seam where none exists, Divert the Flow to move cross-organizational activity away from legacy, and Revert to Source to integrate at the originating data source instead of through accreted copies.
The façade is a control plane, so record it like one
What makes the strangler fig safe is that routing is explicit and reversible: traffic moves on your schedule, per slice, with a rollback path. That means the routing table is one of the most consequential artifacts of the whole program — who moves, in what order, under which flags, with what rollback. On the E-Tax modernization we recorded the traffic-splitting strategy between the monolith and the new services in an ADR before any traffic moved, and updated the record as slices migrated. If your decision practice is informal, the façade’s routing rules will accrete into exactly the undocumented sprawl you’re escaping — treat each split as a decision worth a record.
Azure’s operational caveats deserve copying into your backlog: the façade must keep up with the migration, must not become a single point of failure or a performance bottleneck, and new services should themselves be structured with “clear demarcations” so the next migration can intercept and replace them cleanly.
Inside the code: branch by abstraction
The same incremental discipline applies inside a codebase. Branch by abstraction — a technique Paul Hammant named while advocating trunk-based development — replaces a supplier (library, module, subsystem) gradually while the system keeps shipping: introduce an abstraction between clients and the current implementation, migrate clients to the abstraction, build the new supplier behind it, compare behaviors behind feature flags in test environments, then switch clients incrementally and delete the old supplier. It is the in-code cousin of the strangler fig: both reject long-lived divergence in favor of a system that is releasable at every step.
The data problem is the hard problem
Code coexists gracefully; data usually doesn’t. The legacy store stays the system of record for every unmigrated capability, so the new services must read from, then write to, a store they will eventually abandon. Azure’s worked example is the pattern to copy: for each domain, migrate the relevant tables with an ETL load into a new domain database, keep it synchronized with change data capture from the monolith’s transaction log, validate consistency between both stores, then cut the new system over to the domain database as system of record — and only then remove the legacy tables. Their rollback guidance is the part teams learn the hard way: while the CDC sync still exists, rollback is cheap; after the legacy objects are removed, rollback means restore-and-replay. “Treat the removal of legacy objects as a deliberate final step for each domain.” Where the legacy code cannot be touched at all, event interception from the database itself (log-based CDC, message-on-insert) provides the seam the application layer lacks.
What the evidence says
Two studies frame expectations. Fritzsch, Bogner, Wagner and Zimmermann’s qualitative study of microservices migration in industry (ICSME 2019; 14 systems, 16 interviews across 10 companies) found maintainability and scalability driving the migrations, but also that “most companies preferred a rewrite” over incremental splitting — usually because they lacked decomposition approaches — and that finding the right service cut was a leading technical challenge. That is the trap the strangler discipline exists to close: a rewrite that starts as “all at once” because nobody could name the slices. Faustino, Gonçalves, Portela and Rito Silva’s 2022 study measured a two-step migration and found the effort and performance costs are already substantial when moving a domain-model-rich monolith merely to a modular monolith — their point is exactly the right one: making the intermediate step explicit lets you decide whether to complete the migration or stop at a well-modularized system. Strangler fig gives you that option at every slice; big-bang burns it.
Sequencing: risk and value, not org chart
Order the slices by two axes: business value delivered early, and risk retired early. The first slices should be low-dependency, high-visibility capabilities — they prove the façade, the pipeline, and the coexistence machinery while stakes are modest. Defer the slices wrapped around shared legacy tables until CDC and validation are rehearsed. And keep a decommission budget: a migration that only ever adds services is not a strangler fig, it is an infestation.
Plan your incremental migration
Sources
- Martin Fowler, “StranglerFigApplication” (bliki; first published 2004, revised 2024)
- Microsoft Azure Architecture Center, “Strangler Fig pattern”
- Ian Cartwright, Rob Horn & James Lewis, “Patterns of Legacy Displacement” (martinfowler.com, 2021, rev. 2024)
- Martin Fowler, “BranchByAbstraction” (bliki, 2014; term coined by Paul Hammant)
- Sam Newman, “Monolith to Microservices: Evolutionary Patterns to the Rescue”, O’Reilly, 2019
- Fritzsch, Bogner, Wagner & Zimmermann, “Microservices Migration in Industry: Intentions, Strategies, and Challenges” (ICSME 2019; arXiv)
- Faustino, Gonçalves, Portela & Rito Silva, “Stepwise Migration of a Monolith to a Microservices Architecture: Performance and Migration Effort Evaluation” (arXiv, 2022)