Strangler fig pattern
The strangler fig pattern replaces a legacy system gradually: new code takes over one piece at a time behind a routing layer until the old system can be removed.
The name comes from Martin Fowler, who compared this approach to a fig that grows around a host tree and eventually replaces it. Applied to software, you build the new system around the edges of the old one. A routing layer sits in front of both and decides, route by route, which system answers. Over time more traffic goes to the new system, and the old one shrinks until it can be switched off.
Both systems are in production the whole time. Users keep working, and every step is small enough to release and to undo.
Example
A logistics company runs an AngularJS application with forty screens. The team puts a shell in front of it. At first every route goes to the AngularJS application. Then:
/trackingis rebuilt in Angular and the shell routes it to the new code./invoicesfollows a month later.- When the last route has moved, the AngularJS bundle is deleted.
At each step the product works completely, and a route can be sent back to the old code if the new version has a problem.
Common misunderstanding
The pattern is sometimes read as "add new code next to the old code". Without the routing layer and without a plan to remove the old system, you end up with two systems to maintain forever.
The pattern has three parts: intercept, replace and retire. The last one is the part that gets skipped when the budget runs out, so the hardest and least used screens should be scheduled explicitly. The guide How to migrate AngularJS to Angular without downtime applies this pattern step by step.
Why it matters. It is the reasoning behind almost every low-risk frontend migration: the legacy application keeps running while routes move to the new one, and each move can be reversed.
Related terms
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn