The seductive trap of the big rewrite
Every engineering team working with a legacy system eventually has the same conversation: “What if we just rewrote it from scratch?” The codebase is tangled, the technology is outdated, the original developers are long gone, and every change feels like defusing a bomb. The rewrite seems like the rational choice — a clean start with modern tools and the benefit of hindsight.
And yet, the big rewrite fails with alarming regularity. The new system takes twice as long as estimated. Feature parity with the old system proves far more complex than anticipated because the old system encodes years of edge cases and business rules that nobody documented. Meanwhile, the old system keeps running, keeps accumulating new requirements, and the target keeps moving. By the time the rewrite is ready, it is already behind.
The strangler fig pattern offers an alternative. Named after the tropical fig that grows around a host tree, gradually replacing it, the pattern lets you modernise a legacy system incrementally — one capability at a time — without ever stopping the existing system.
The strangler fig pattern is not faster than a rewrite. It is more likely to succeed — and in software engineering, finishing is more important than speed.
How the pattern works
The core mechanism is simple: place a routing layer (typically a reverse proxy or API gateway) in front of the legacy system. When you are ready to modernise a specific capability, build it as a new service. Route traffic for that capability from the legacy system to the new service. The rest of the traffic continues to flow to the legacy system unchanged. Over time, as you build more new services, less traffic reaches the legacy system until eventually it handles nothing and can be decommissioned.
The elegance is in what this allows: you can modernise at your own pace, prioritising the capabilities that deliver the most business value. You can roll back any individual migration without affecting the rest of the system. You can run old and new implementations side by side and compare results before cutting over. And you never have to explain to stakeholders why the system is down or features are frozen while you rewrite.
Lessons from applying it at Logicbric
We have used the strangler fig pattern on multiple client engagements and in our own products. When building Downstream ERP, we migrated an existing oil and gas operations system that had been running for over a decade. The key lessons:
- The anti-corruption layer is essential. When building the new service, do not replicate the legacy data model. Design the data model correctly for the new service and build a translation layer between old and new. This prevents legacy design decisions from infecting the new system.
- Start with the capability that changes most frequently.This is where the legacy system causes the most pain and where modernisation delivers the most immediate value. In Downstream, this was the procurement workflow — constantly evolving to accommodate new supplier relationships and compliance requirements.
- Data migration is the hidden monster. Moving code is straightforward. Moving data — with all its inconsistencies, relationships, and implicit assumptions — is where most of the complexity lives. Plan for data migration to take 3x longer than you expect.
- Feature parity is a trap. Do not try to replicate every feature of the legacy system. Some features exist because of historical accidents, not user needs. Use the migration as an opportunity to prune capabilities that no longer serve the business.
When the strangler fig is wrong
The pattern is not universally applicable. If your legacy system has no clear boundaries — if every function calls every other function in an undifferentiated tangle — the strangler fig pattern is difficult to apply because you cannot isolate capabilities cleanly. In these cases, you may need to invest in modularising the monolith first before extracting services. Also, if the legacy system runs on infrastructure that is being decommissioned (end-of-life hardware, expiring licenses), you may not have the luxury of gradual migration.
What this means for your team
If you are maintaining a legacy system and the pressure to modernise is mounting, resist the allure of the blank page. The strangler fig pattern lets you deliver value continuously while modernising incrementally. It requires discipline — you must maintain both systems during the transition — but it dramatically reduces the risk of the project failing entirely. Start with one capability, prove the pattern works in your context, and build momentum from there. The legacy system was not built in a day, and it does not need to be replaced in one either.