What is Strangler Fig Pattern
In this tutorial, we are going to discuss about What is Strangler Fig Pattern. To completely re-write a large, complex codebase with lots of different interactions often with different teams results in a planning nightmare.
Whether you are refactoring from a monolith to microservices or migrating from one technology to another – such as ASP.NET WebForms to Blazor, the change can be a large undertaking. The Strangler Fig pattern enables you to take these migrations at a slower pace, migrating from one system to another system on a module basis rather than in its entirety.
The strangler fig pattern helps migrate a monolithic application to a microservices architecture incrementally, with reduced transformation risk and business disruption.
The Strangler Fig Pattern is a software design pattern that provides a strategy for gradually migrating a legacy system to a new system. The pattern is named after the strangler fig tree, which grows around a host tree and eventually replaces it. Similarly, the Strangler Fig Pattern allows for the gradual replacement of an old system by incrementally developing a new system alongside it until the old system can be completely retired.
Imagine an ancient, humongous tree in a dense forest. This tree represents your old legacy system. One day, a new plant, the Strangler Fig, starts growing at the base of this tree. Over time, the fig grows, wrapping itself around the ancient tree. As it expands, it replaces more and more parts of the original tree until the old tree is entirely enveloped and replaced by the Strangler Fig.
This tree is a metaphor for legacy systems. These systems, often outdated yet deeply integrated, support critical business operations. They’re like the old tree – rooted deeply within the organization’s architecture, its many branches representing the various functions it supports. And replacing these systems can be just as daunting as replacing the old tree.
So how can we replace such deeply rooted legacy systems? There is a solution that allows you to gradually replace parts of the legacy system without causing business disruption. That solution is the Strangler Fig Pattern. It’s named after the Strangler Fig, a tree that grows by gradually enveloping other trees, eventually replacing them.
When to Use
When you need to migrate legacy backend architecture to a newer architecture over a long period of time, the Strangler Fig pattern makes it so that you can migrate to a newer system with minimal disturbance to the existing system.
When Not to Use
If the system replacement is a small system, it may not make sense to use the Strangler Fig pattern. Don’t drag it out if you can migrate the system in a shorter period of time.
If the backend calls cannot be intercepted, then there is nothing to require the use of facades.
What’s It All About?
The Strangler Fig Pattern in software design mimics the process of gradually replacing the legacy system. Instead of replacing a large, old system (the ancient tree) all at once, you build new parts (the Strangler Fig) alongside it. Gradually, the new system takes over functionalities from the old system until the old one can be safely retired.
Why Use the Strangler Fig Pattern?
With rapid technological advancement, organizations need to keep up with the latest technology to stay competitive. However, completely overhauling a legacy system can be risky and disruptive. Here’s where the Strangler Pattern shines – it allows for the gradual replacement of a system, mitigating risk and minimizing disruption.
- Less Risky: You’re not ripping out the old system in one go. So there’s a safety net.
- Flexibility: You can prioritize which parts to replace based on urgency or business needs.
- No Big Bang Releases: Continuous delivery and gradual replacement mean less potential for massive failures.
- Smooth Transition: Users might not even notice the shift as it’s gradual.
That’s all about What is Strangler Fig Pattern. If you have any queries or feedback, please write us email at contact@waytoeasylearn.com. Enjoy learning, Enjoy Microservices.!!