A mid-sized European insurer runs its policy administration on a system built in the late 2000s: a Java application, an Oracle database and several hundred stored procedures that hold most of the premium calculation rules. The board approves a rewrite on a modern platform, planned for eighteen months. Two years later the new system covers roughly sixty percent of what the old one does, and the old one is still being changed, because a regulatory update and a new product for a broker network could not wait. The team now maintains two systems, and the cutover date has slipped by another quarter.
This is not a description of one specific project. It is a shape that recurs often enough that Martin Fowler was writing about it in 2004. His answer was a pattern he first called Strangler Application and, from 2019, Strangler Fig Application: do not replace the system in one go, grow new code around it, piece by piece, until the old one is no longer needed.
This article is for CTOs and architects who are considering the pattern or are already using it. We are not going to repeat the decision between rebuilding, refactoring and replacing, or the general strategy for moving from a monolith to microservices; we have covered both separately. We focus on the mechanics of one pattern and defend a thesis that not everyone will accept: a strangler fig migration is measured by what you have switched off, not by what you have built. The first decision is not the new technology stack. It is establishing which system owns the data for each piece and when the old code will be deleted. Without a budget for deletion, the pattern turns into running two systems indefinitely, which can cost more than a single big-bang cutover.
What is the strangler fig pattern and where does it come from?
Fowler saw strangler figs on holiday in the Queensland rainforest in 2001. These plants germinate in the canopy of a host tree, send roots down to the ground, gradually wrap the trunk and, years later, stand on their own while the host inside dies. A post on his bliki dated 29 June 2004 carried that image over to software. In August 2024 Fowler rewrote the entry from scratch, explaining that the pattern had become popular in the modernisation field, and the new version draws on the work of his Thoughtworks colleagues.
The mechanics are easy to describe. You put a layer in front of the legacy system that every request goes through: a facade, in practice usually a reverse proxy or an API gateway. At first the facade passes all traffic to the old system. Then the team builds one piece of functionality in the new system, and the facade starts routing the matching requests to it. Further pieces follow the same path. When the old system no longer handles anything, it can be switched off and the facade removed, or kept as an adapter for clients that cannot be changed quickly. The pattern’s documentation in the Azure Architecture Center describes exactly these four phases.
What the pattern does not assume matters just as much. It does not assume microservices: the target can be a modular monolith, an off-the-shelf SaaS product or a new version of the same application. It does not assume the cloud or any particular technology. It assumes three things only: that traffic to the old system can be intercepted, that the old system can be divided into pieces with clear boundaries, and that it can keep running for the duration of the migration.
In the new version of his text Fowler stresses that the code which lets both systems coexist is transitional architecture: code that will go away once the modernisation is complete. Its cost is justified because it reduces risk and lets you deliver value earlier. That sentence contains the whole economics of the pattern. You pay for scaffolding so that you do not pay for a disaster. But if the scaffolding is never taken down, you keep paying for it.
Why do full rewrites fail so often?
Fowler is blunt about the plan to replace a whole system at once: he has seen that simple-sounding plan go down in flames most of the time. The reasons are well known and worth naming, because the strangler fig is a separate answer to each of them.
The first reason is time. Replacing a serious system takes a long time, and the business does not stand still meanwhile. Every change demanded by the market or by regulators has to go into the old system and then again into the new one. The target the team is chasing moves at the same speed the team is running.
The second reason is feature parity. Ian Cartwright, Rob Horn and James Lewis of Thoughtworks, in their 2021 series “Patterns of Legacy Displacement”, describe it as a trap in its own right: the desire for the new system to do everything the old one did leads to a huge effort to document “as is” behaviour and to a plan for one big-bang cutover. Fowler adds that much of the existing behaviour is not really wanted, so rebuilding it is waste. The problem with a rewrite is that you do not know which part. The strangler fig lets you find out in production: you move a piece, see what users actually look for, and only then decide what to rebuild.
The third reason is knowledge buried in code. In a system that is fifteen years old, business rules live in stored procedures, in batch jobs that run overnight and in workarounds added after incidents nobody remembers. A rewrite needs all of that discovered before it starts. The strangler fig lets you discover it one piece at a time, and lets the people who still remember the old rules review each piece while it is small enough to review.
The fourth reason is cutover risk. On big-bang day every defect in the new system appears at once, on all the traffic and all the data. Rolling back is possible only in theory, because after a few days of operation the new system’s data has already diverged from the old. The strangler fig spreads that risk across dozens of small cutovers, each of which can be undone with one routing change. None of this means a rewrite is always wrong. We have written about when it is justified in our rebuild, refactor or replace decision matrix. Here we assume the decision to replace gradually has already been made.
How do the facade and request routing work?
The facade is the only place that needs to know which system handles a given request. For the client, whether that is a browser, a mobile app or a partner’s system, the address does not change. Microsoft puts it briefly: customers continue to use the same interface and are unaware that a migration is in progress.
In web systems the facade is usually a reverse proxy (NGINX, HAProxy, Envoy) or an API gateway. Routing rules can use several criteria. The simplest is the path: /claims/* goes to the new system, everything else to the old one. More precise options are headers, customer or tenant ID, region or a percentage of traffic. Routing by customer is particularly useful in B2B systems, because you can move one tolerant customer first and the rest later. Percentage routing is what canary releases need, which we cover below.
Routing rules should be configuration, not code shipped with the application. Switching a piece over and switching it back must take minutes, without a new release. Feature flags work well here, because they let you change the direction of traffic for a chosen user group without touching infrastructure. Every rule change should leave an audit trail: who, when, for which scope. In regulated sectors this is more than good hygiene. The EU’s Digital Operational Resilience Act, which has applied to financial entities since January 2025, expects documented ICT change management, and a migration made of small, logged, reversible routing changes is far easier to evidence than a single weekend cutover.
Microsoft names three typical weaknesses of the facade. First, it has to keep up with the migration: if the team builds new pieces faster than anyone updates the rules, new code sits idle. Second, it must not become a single point of failure. The facade carries all traffic, so it must be redundant, monitored and have a latency budget you can measure. Third, it must not become a performance bottleneck. Every extra network hop costs milliseconds, and across a chain of calls that becomes visible to users.
There is a fourth weakness that gets less attention: the temptation for the facade to do more than route. It starts with a small header transformation, then merging responses from both systems, then a business rule “just for now”. A year later the facade is a third system with its own logic that nobody planned and nobody can remove. The rule is simple: the facade knows where to send a request, not what to do with it. Translating between models is the job of an anti-corruption layer, not the facade.
How do you choose the first piece to carve out?
This is where the decision that most determines the outcome of the migration is made, and where it most often goes wrong. The natural instinct of an engineering team is to slice by layer: a new front end first, then a new API, the database last. That looks logical on a diagram, but it does not let you switch anything off until the last layer is finished. For all that time the new code runs on old data, and the old system has not lost a single responsibility.
It is better to slice by business capability and data ownership. A piece is something that handles one process end to end: claims intake, shipping quotes, product catalogue. A good first piece has several properties at once. It has a clear boundary in the data, meaning it uses tables the rest of the system barely touches. It has moderate business value: big enough for the team and the board to see an effect, but not so critical that a defect stops revenue. Its behaviour is measurable and can be compared with the old system. And it has a business owner who will sign off the cutover.
Fowler writes in the new version that a migration often begins with small additions, frequently new features, built on top of but separate from the legacy code base. That is a good starting point, because a new feature requires rebuilding nothing that already exists. It has a limit, though: a new feature takes no responsibility away from the old system. If you spend a year building only new features alongside the legacy system, you have a bigger estate, not a smaller legacy. So the first piece can be a new feature, but the second should already take something away from the old system.
Useful techniques for finding boundaries include event storming, value stream mapping and dependency analysis of code and database. In “Patterns of Legacy Displacement”, Thoughtworks describes these as the first activity: understanding the desired outcomes and breaking the problem into smaller parts before delivering anything. It is also worth doing something less elegant: going through production logs to see which paths are actually used. In old systems some screens and reports usually turn out not to have been opened in months. The cheapest piece to migrate is the one you can simply switch off.
One more piece of advice: do not start with the piece that is technically the most painful. The first migration exists to build and test the whole mechanism: the facade, routing, synchronisation, monitoring and rollback procedure. On a hard piece the team learns the mechanism and the domain at the same time, and a failure will undermine confidence in the entire approach.
Why do you need an anti-corruption layer and where does it go?
During the migration both systems have to talk to each other. The new claims piece needs customer data that still lives in the old system. The old billing logic needs to know about a claim already approved in the new one. The simplest solution is to let the new code read the old database directly and use its structures. It is also the most dangerous, because after a few months the new system thinks in the old system’s terms: the same abbreviated field names, the same status flags whose meaning only the 2009 authors understood, the same structure you set out to escape.
The anti-corruption layer, a concept from Eric Evans’s 2003 book “Domain-Driven Design”, is an adapter that translates requests and data between two models. Microsoft’s strangler fig guidance recommends it precisely for handling cross-system dependencies during migration: it protects the new system’s design from legacy semantics and lets the legacy system reach new services without significant code changes. Without such an adapter, cross-system dependencies either break components or force the new system to adopt legacy conventions.
In practice the anti-corruption layer is a separate module or service with three parts. A facade on the legacy side exposes its data and operations in an orderly form. A translator maps old concepts onto new ones, for example status 3 with column HOLD_FLG = 'Y' becomes “policy suspended pending premium payment”. An adapter on the new side presents those concepts in the new system’s own language. Everything known about how the old system really behaves ends up in one place instead of leaking across the new code base.
Where should it sit? Wherever the boundary runs between migrated and unmigrated pieces, in both directions. The new system asking for customer data goes through the anti-corruption layer. The old system that has to tell the new one about a change goes through it as well, preferably via events rather than direct calls. Every anti-corruption layer is transitional architecture: once customer data has fully moved to the new system, the adapter for the old customer model disappears. If the team treats it as a permanent part of the architecture, that is a sign the migration has no plan to finish.
The anti-corruption layer is also the best place for contract tests. Every behaviour of the old system that the new one depends on should be written down as a contract and checked automatically, because the old system is still changing. We have described how to do that in practice in our article on contract testing between services.
How do you keep data in sync while two systems run side by side?
This is the hardest part of the pattern and the one that descriptions along the lines of “the facade redirects traffic” tend to skip. Redirecting an HTTP request is easy. Making both systems see a consistent state after the redirect is not.
The core rule is: for every domain, at every moment, there is exactly one source of truth. At the start it is the old database. During the migration of a piece it moves to the new one, but at a single, planned moment, not gradually and not in several places at once. Everything else is a copy that may be stale, and everyone on the team has to know which copies those are.
A typical path for one domain, close to the one Microsoft describes, looks like this. First the new service handles requests but reads and writes data in the old database, through the anti-corruption layer. Next a separate domain database is introduced: historical data is loaded once with an ETL process, and ongoing changes in the old database are replicated with change data capture, which reads the transaction log (in open source most often Debezium; SQL Server has built-in CDC). During this phase the contents of both databases are compared. Only after validation does the new database become the source of truth, and replication reverses direction if the old system still needs the data for reads. Finally, the domain’s tables and procedures are removed from the legacy database.
Microsoft highlights the point that determines whether you can roll back: as long as the domain tables and synchronisation processes still exist in the legacy database, going back is straightforward. Once they are removed, rolling back means restoring those objects and replaying data changes, which significantly increases effort and risk. That is why removing legacy objects should be a deliberate, separate step after validation, not part of the cutover.
The pattern to avoid is dual writes from application code: the same operation writes a change to both the old and the new database. It looks simple, but when one database or the network between them fails, a change reaches only one side and there is no transaction to fix it. If dual writes cannot be avoided, you need a reconciliation process that regularly compares both databases and reports differences. Sam Newman’s book “Monolith to Microservices” devotes a whole chapter to decomposing the database, with patterns such as the database view, database wrapping service, synchronising data in the application and the tracer write. The common thread is the same: settle data ownership first, then move the code.
That is where the thesis of this article becomes practical. A piece counts as migrated not when the new code is serving traffic, but when the new system is the source of truth for its data and the legacy objects have been deleted. Before that, you only have a new interface on top of the old system. The same principle applies if you are breaking a monolith into services; our monolith to microservices decision guide covers the wider assessment.
How do you switch traffic safely: dark launch, parallel run and canary?
The facade gives you control over who reaches which system. It supports three techniques, best applied in this order.
Dark launch. The new piece receives a copy of real traffic, but its responses never reach the user. The team checks whether the new service can take production load at all, how latency is distributed and what errors appear on data that never existed in the test environment. Cartwright, Horn and Lewis list dark launching among their legacy displacement patterns.
Parallel run. Both systems process the same request, the user gets the old system’s answer, and differences are recorded and analysed. The best-known public example comes from GitHub, which described its Scientist library in 2016: it runs the old and new code on each call, compares results and timings, records mismatches and returns the old code’s result. GitHub used it when replacing the permissions code for repositories, teams and organisations, which is exactly where an error is most expensive. Parallel run works well for computational logic: pricing, discounts, premium or tax calculation, permissions. It works poorly for operations with side effects, such as sending an email or charging a card, because those cannot be executed twice.
Canary. Real traffic moves over gradually. First one percent, then five, twenty, fifty, a hundred, with predefined error and latency thresholds that send traffic back to the old system automatically when breached. Instead of percentages you can switch by segment: internal users, one customer, one country.
Two rules connect all three techniques. First, every cutover has a prepared route back, tested before the cutover rather than improvised during an incident. Second, success criteria are written down in advance and in numbers: for example, a parallel-run mismatch rate below an agreed threshold for a week, an error rate no higher than the old system’s, response time at an agreed percentile. Without those numbers, the decision to switch fully becomes a question of the mood in the meeting room.
What if traffic to the legacy system cannot be intercepted?
The pattern in its pure form assumes every request passes through a point where you can place a facade. In many legacy systems that is not true. A desktop client talks straight to the database. Nightly batch jobs read files from a network share. Logic sits in stored procedures called by other systems. A mainframe accepts transactions through a queue nobody has documented.
That does not rule the pattern out, but the facade has to sit somewhere else. There are several proven places.
Event interception. Instead of requests, you intercept the events that change state: messages on a queue, exchange files, database writes. Cartwright, Horn and Lewis describe this as a pattern of its own. Microsoft gives an example for database-centric systems: the database itself can send messages to new services, for instance via a trigger fired on insert, or changes can be read from the transaction log with CDC. The application code does not have to change.
Branch by abstraction. When the piece to be replaced lives inside the code rather than at its edge, the facade becomes an interface in the code. Fowler describes the technique, named by Paul Hammant, in four steps: introduce an abstraction over the part to be replaced, move all clients onto it, build a new implementation behind it and switch clients over gradually, then delete the old implementation. This works only if you have access to the code and can deploy it.
User interface replacement. When users work in an old application and new features are to be available in the browser, the switch point can be the interface itself: a new screen replaces the old one, and the old module disappears from the menu.
There is also a line beyond which the pattern stops working. Microsoft states it plainly: if you cannot access the legacy system’s source code and it has no other integration point you can change, such as its database, the strangler fig is not suitable. Disabling migrated features and redirecting internal calls requires the ability to modify the legacy system. That is often the case with closed products whose vendor no longer exists, or with systems whose licence grants no right to modify them.
When does the strangler fig pattern not work?
The strangler fig has become the default answer to any modernisation question, and default answers deserve scrutiny. Microsoft’s documentation lists four situations where the pattern might not be suitable: requests cannot be intercepted; there is no access to the code or another changeable integration point; the system is small and replacing it whole is simple; and the original solution has to be decommissioned quickly. To those four we add four more that come up more often in practice.
The legacy system is tightly tangled in one database. If every table joins to every other and stored procedures change data across several domains at once, there is no piece with a clean boundary. The first stage is then not migration but refactoring inside the old system to create such boundaries. That can take many months before the first piece leaves the legacy system.
There are no tests and no observability. The pattern relies on comparing the behaviour of the old and new systems. If you do not know how the old system behaves, because it has no tests, logs or metrics, you have nothing to compare against. You first need to wrap critical paths in characterisation tests that record current behaviour, even where it is wrong.
The organisation cannot run two systems for long. The strangler fig means that for months or years the team maintains the old system, builds the new one and looks after the transitional architecture. If the only people who know the old system are two developers who are also meant to build the new one, the pattern will stall.
The goal requires a new business model, not a new system. If a company is changing how it sells, for instance from perpetual licences to subscriptions, and the old system is built around the old model, moving it piece by piece recreates the old model in new technology. Sometimes it is better to build a new product line alongside and move customers rather than features. The catalogue by Cartwright, Horn and Lewis includes patterns built on extracting product lines rather than individual functions.
It is also fair to say that the strangler fig does not remove risk; it moves it. Instead of the risk of one cutover, you carry the risk that the migration stalls halfway. That second risk is less dramatic but no less expensive. If you are unsure whether continuing to carry the legacy system pays at all, a cost-benefit analysis of technical debt remediation is a useful starting point.
How do you measure progress so you do not end up with two systems forever?
The most common way strangler fig projects fail does not look like failure. The new system works, new services keep appearing, the team reports progress. Only the old system still runs the same processes, still costs the same in licences and servers, and its switch-off date slips from year to year. The organisation pays for two systems and for the transitional architecture between them.
This happens because progress is measured by activity: the number of new services, completed stories, screens in the new interface. Those numbers grow whether or not the legacy system shrinks. The thesis of this article translates into a simple reporting rule: what counts is what has been switched off.
| Measure | What it shows | How to count it | Warning sign |
|---|---|---|---|
| Share of traffic on the new system | How many requests and transactions the new system handles | Facade logs, percentage of requests and of transaction value | Service count grows, traffic share stays flat |
| Capabilities fully migrated | For how many business processes the new system is the source of truth | List of capabilities with the date the source of truth moved | Pieces “almost migrated” for several months |
| Legacy code and database objects deleted | Whether the old system is actually shrinking | Lines of code, procedures, tables and batch jobs removed from the legacy system | Zero deletions after two quarters of migration |
| Legacy run cost | Whether savings materialise | Licences, infrastructure and team hours spent on the old system per month | Legacy cost unchanged despite migrated pieces |
| Changes still made to the legacy system | Whether the business has stopped extending the old system | Number of functional changes to legacy code per quarter | New features still landing in the old system |
| Lead time for change in migrated areas | Whether the migration delivers the benefit it was started for | Time from request to production in the new system versus the old | Changes in the new system take as long or longer |
| Size of the transitional architecture | Whether the scaffolding is being dismantled | Number of active adapters, replications and routing rules | Adapter count rising while pieces are migrated |
Two measures from this table are worth showing the board every quarter: legacy run cost and the number of capabilities fully migrated. The rest are for the team and the architect. If you need a wider framework for reporting recovery outcomes to the board, see our article on software rescue success metrics.
On top of that you need two documents that many projects never write. The first is a decommissioning plan: for each piece, the date after which the old code and database objects will be deleted, and the person accountable for that decision. The second is a freeze rule: from a given date, new features in a given area are built only in the new system, and exceptions are approved by the migration owner. Without the freeze, the business will, quite rationally in the short term, keep ordering changes in the old system, because that is where they are quicker.
What does the transitional architecture cost and how do you budget for it?
There is no reliable public study that gives a typical share of transitional architecture in the cost of a strangler fig migration, so we will not quote a figure. We can, however, list the components of that cost and the factors that drive it.
There are four components. The first is the facade: infrastructure, configuration, monitoring and maintenance of routing rules. The second is anti-corruption layers and adapters, built for every boundary between the systems. The third is data synchronisation: ETL processes, CDC replication, reconciliation and database comparison. The fourth is running the legacy system for the whole migration, including licences, infrastructure and the people who know it. For a large legacy estate with commercial database and middleware licences, that fourth item alone can be the largest line in the budget, which is one more reason to measure progress by what is switched off.
The main driver of these costs is how many pieces are “halfway” at the same time. Each piece in flight has its own adapters, replications and rules. If the team works on two pieces at once, the transitional architecture stays small. With ten in flight, it is ten times larger and ten times harder to reason about. The second driver is a tangled database: the more data domains share, the more synchronisation you need. The third is time: every month of migration is a month of running two systems.
Three budgeting rules follow. First, limit the number of pieces in progress, just as Kanban limits work in progress. It is better to finish one piece, including deleting the old code, than to run five in parallel. Second, include the cost of dismantling in each piece’s budget: removing adapters, replications, old tables and routing rules. This work is easy to skip because it delivers no new feature. Third, present a falling legacy cost in the business case as a condition for later stages, not as a promise for the end. If the legacy cost has not moved after two pieces, that is a reason to revisit the plan, not to speed up.
When estimating, prepare for the question the board will ask sooner or later: when does it end? The honest answer for a strangler fig is that it ends when the last piece moves, and that moment depends on how many pieces turn out to be unnecessary. So instead of a single date, show a range and use the measures from the previous section to track progress against it.
How should you organise the team and accountability for the migration?
Conway’s law applies to migrations too: the structure of the new system will mirror the structure of the teams that build it. If the migration is run by a separate “new system team” next to an “old system team”, you get two worlds with a thin, contested boundary. The new team does not know the rules hidden in the old code, and the old team has little motivation to explain them, because its system is being switched off.
What works better is splitting by domain: one team owns a business capability, such as claims, in both systems at once. It maintains the old version, builds the new one, runs the migration and deletes the old code. That way the same people who know the old rules design the anti-corruption layer, and the decision to switch off does not require negotiation between teams.
You also need a role that rarely appears in organisation charts: the migration owner. This is the person who keeps the decommissioning plan, approves exceptions to the legacy change freeze, reports the measures from the table to the board and has the authority to stop work on a new piece until the previous one is closed. Without that role, every local decision is rational and the sum of them leads to two systems forever.
Knowledge of the old system is often concentrated in a handful of people. Losing any of them mid-migration means the rules in the stored procedures will have to be reconstructed from code instead of memory. Plan for it: document the areas where knowledge is most concentrated first, and involve those people in designing the anti-corruption layer, not just in answering questions.
Finally, capacity. A strangler fig migration needs, at the same time, legacy maintenance, new development and transitional engineering: data replication, routing, comparison testing. If the in-house team lacks skills in one of these areas or simply lacks time, adding external specialists for the duration of the migration can cost less than extending it by several quarters. Before doing that, though, it pays to know the state of the old system. At ARDURA Consulting a code health audit takes 1–2 weeks, starts from €4,500 and ends with a remediation plan that makes it easier to decide the order of migration. Our legacy system modernization checklist lists what to assess before you commit to a sequence.
What are the key takeaways for a CTO planning a strangler fig migration?
The strangler fig pattern is not a technique for building a new system; it is a discipline for switching off an old one. The facade, routing, anti-corruption layers and data replication are tools that let you move responsibility piece by piece and reverse any step. But if success is measured by the number of new services rather than by the shrinking of the legacy system, the pattern leads to two systems maintained indefinitely.
Remember eight things. First, the facade only routes traffic, it does not process it: routing rules are configuration, and business logic never goes into the proxy. Second, slice by business capability and data ownership, not by technical layer. Third, the first piece is there to prove the mechanism, and the second should already take something away from the old system. Fourth, protect the new system’s model with an anti-corruption layer and treat it as temporary. Fifth, every domain has exactly one source of truth at any moment; avoid dual writes from application code. Sixth, switch traffic in the order dark launch, parallel run, canary, with a route back tested before every cutover. Seventh, check the boundary conditions: if traffic cannot be intercepted, the system is small or it has to be retired quickly, the pattern may not be the right one. Eighth, measure progress by what is switched off: legacy run cost, capabilities fully migrated and code deleted.
If your legacy system is stuck halfway through a migration, or you are still deciding which piece to start with, see how we work on software rescue and legacy modernization, or get in touch. We start with a code health audit that, in 1–2 weeks, ends with a remediation plan: what to stabilise, what to rebuild and where to begin.