Introduction
Every team running a legacy application eventually hears the same pitch: rewrite it from scratch. Two years later, the rewrite is still not live, the old system has kept changing underneath it, and the business is paying for two platforms. The strangler fig pattern is the alternative: build the new system around the old one, move functionality over one slice at a time, and retire the legacy code only when nothing depends on it.
Related: Legacy application modernization: how we choose one of six paths for every system
What is the strangler fig pattern?
The strangler fig pattern (often shortened to the strangler pattern) modernizes a legacy application gradually: new components take over its functions one by one until the old system can be switched off. Martin Fowler named it in 2004 after the strangler figs of the Queensland rainforest, which grow around a host tree until they no longer need it. In software, a routing layer (facade) sits in front of the legacy app and decides, request by request, whether the old or the new system answers.
How it works
Transform, coexist, eliminate. Then repeat.
Build the new component, run it next to the old one behind the facade, then remove the old code path. Repeat for every slice until the legacy system serves no traffic.
Strangler fig vs big-bang rewrite
A big-bang rewrite bets everything on one cut-over day. The new system must reach full feature parity before anyone uses it, and rolling back after the data moves is often impossible. The strangler fig spreads that risk across many small releases. The price is temporary complexity: for a while you run two systems and a routing layer.
| Compared on | Strangler fig | Big-bang rewrite |
|---|---|---|
| First value for users | After the first slice goes live | Only at go-live, after full feature parity |
| Rollback | Per slice: route back to the legacy path, after syncing any data the new part wrote | Often impossible once the data has moved |
| Main risk | Running two systems and a routing layer for a while | A long build that misses behavior the old system had |
| Validation in GxP | Per slice, scaled to its risk | The whole system at once, before go-live |
| Best fit | Large, business-critical systems that must keep running | Small systems, or ones with no seams to route around |
The trade-off
Running two systems for a while buys you the right to roll back.
A rewrite gives you no exit until go-live. A strangler fig gives you one after every release.
The strangler fig in GxP-regulated systems
- 01
Validate per slice
Each slice gets its own risk assessment, requirements trace and test evidence. Under the FDA’s risk-based Computer Software Assurance (CSA) approach, low-risk slices need lighter testing.
- 02
No gaps in the audit trail
21 CFR Part 11 expects a secure, time-stamped history of who created, changed or deleted each record. While both systems run, keep both audit trails retained and linked, so each record’s full history can be shown in an inspection.
- 03
The facade is in validated scope
The routing layer decides which system creates a record. Version its rules and log every change.
- 04
E-signatures must not break
When a signed workflow moves, test that signature meaning, record linkage and identity checks behave the same.
- 05
Plan the retirement early
Retiring a validated system needs data retention, archive access for inspections and a documented decommission.
- 06
Protect PHI in transit
Under the HIPAA Security Rule, any sync or dual write of ePHI between the old and new data stores needs access control and audit logs. Encrypt it in transit too, or document an equivalent control.
Checklist: Are you ready to start the migration?
Before the first slice moves, tick what is already in place.
Not ready yet. Start by mapping the system and putting the facade in place.
How to apply the pattern, step by step
This is also how we run legacy application modernization projects: after a 2-week assessment, we move one slice at a time behind the running system, starting in week 3.
- Map the legacy system List modules, integrations, users and data stores, and what changes or breaks often.
- Put a facade in front of it Route all traffic through a proxy or API gateway, still 100% to the legacy app.
- Pick a low-risk first slice A reporting module, a read-only API or one workflow, not the core transaction engine.
- Build it and run both side by side Compare outputs with the legacy system on shadow traffic before moving users.
- Switch the route, keep the rollback Point the facade at the new component and keep the legacy path ready.
- Remove the old path, then repeat Delete legacy code for the slice. When nothing is left, retire the system.
Data & App Modernization
We find the first slice that pays off
A 2-week, fixed-fee assessment maps your system, picks the first slice and plans the path to retiring the old platform. Migration starts in week 3, and every release ships with test and traceability records. Fixed fee from €5,000 in Europe, £4,700 in the UK and $6,000 in other regions.
FAQ
What is the strangler fig pattern?
A way to replace an old application piece by piece. A routing layer sends each request to the old or the new system, and more traffic moves to the new one with every release until the old system can be switched off.
Is it the same as microservices?
No. The strangler fig is a migration method; microservices are one possible target architecture. You can strangle a monolith into microservices, into a cleaner modular application or into standard software plus a few custom services. The pattern only defines how you move: one slice at a time, behind a routing layer, with the old system running until the end.
How long does a strangler fig migration take?
It depends on how many slices the system has and how tangled its data is. In our Data & App Modernization work, the assessment takes 2 weeks, migration starts in week 3, and a modernized slice goes into production every 8–12 weeks. The projects behind the results on that page took from 12 to 55 weeks. Give the retirement of the last slices a date and a budget from the start, or the migration can stall halfway.
Can you use it on a GxP-validated system?
Yes, if every slice is handled as a controlled change. Each slice gets a risk assessment, requirements trace and test evidence, the facade’s routing rules sit in validated scope, and the audit trail and electronic signatures stay intact across both systems, as 21 CFR Part 11 expects. The evidence supports your validation; it is not a certificate, and your QA still signs off each release.
How is it different from lift-and-shift?
Lift-and-shift, or rehosting, moves an application to new infrastructure, usually the cloud, without changing its code. It is fast, but the old design and its problems move with it. The strangler fig replaces the application itself, slice by slice. The two combine well: rehost first to leave an old data center, then strangle the application in its new home.
When should you not use this pattern?
When the application is small enough to replace in one short release; AWS’s guidance notes that for small applications, where a full refactor is not complex, a rewrite can be more efficient. Also when requests cannot be intercepted, for example a closed vendor product with no API, when every slice would need two-way writes to the same tables, or when the system will soon be retired or replaced by standard software. Then retiring, repurchasing or a planned cut-over costs less.
Modernize without stopping the business
Tell us which legacy system is slowing you down. In a free 30-minute system review, an architect looks at where a first slice could start and what it would take to validate it. Within three days you get a written note on the likely path.
Sources: Martin Fowler, Strangler Fig (martinfowler.com, first published 2004, updated 2024); AWS Prescriptive Guidance, Strangler fig pattern; Microsoft Azure Architecture Center, Strangler Fig pattern.