Geschätzte Lesezeit 11 minutes

Techblog

Strangler Fig Pattern

Learn in this comprehensive guide what the Strangler Fig Pattern is, how it works, and why it is a genuine alternative to Big-Bang Migration. We explain the advantages and the process of this method and show you how you can modernize your software step by step without taking major risks. 

Strangler Fig Pattern bedeutet zu deutsch Würgebaum Schema. Auf dem Bild zu sehen sind Pflanzenblätter auf einer Platine und eine Schere mit MaibornWolff Logo.

Are you already dreading the day when your old software will be turned off and the new one suddenly activated? The bad news: Your fear is justified! These so-called Big-Bang Migrations often don’t work as seamlessly as hoped. But we also have good news: Thanks to the Strangler Fig Pattern, there’s a safer alternative. 

Learn in this comprehensive guide what the Strangler Fig Pattern is, how it works, and why it is a genuine alternative to Big-Bang Migration. We explain the advantages and the process of this method and show you how you can modernize your software step by step without taking major risks. 

Strangler Fig Pattern: Key Points 

No time to read the entire guide? Don’t worry: We’ve summarized the key points for you. 

  • Definition: The Strangler Fig Pattern is a low-risk method for software modernization
  • Naming: The Strangler Fig Pattern is named after the Australian strangler fig plant. However, mistakenly, the name Strangler Pattern has also become established. 
  • Approach: With this method the old application is gradually replaced by new functions. The old system remains functional throughout the entire process. 
  • Advantages: The main aspects are low-risk modernization, flexibility, cost efficiency, improved maintainability, and user satisfaction. 
  • Challenges: Ensuring data integrity and the risk of premature project completion must always be considered. 
  • Use Cases: The Strangler Fig Pattern is particularly suitable if a component is heavily outdated, can be well isolated, and there is a clear understanding of new functions.

What is The Strangler Fig Pattern? 

Modernizing software is a challenging project that comes with many obstacles. Particularly, the abrupt switch from one system to another can lead to many problems. 

The Solution: Instead of replacing the entire system at once, individual components are renewed step by step – using the Strangler Fig Pattern. 

Strangler Fig Pattern: A Definition 

The Strangler Fig Pattern, also called Strangler Pattern, is a low-risk method for software modernization, where an old application is gradually renewed. The code of the legacy application remains largely unchanged while the new functions are built piece by piece around the old application.  

The Strangler Fig Pattern, also Strangler Pattern, first described by Martin Fowler, is named after the Australian strangler fig. This plant grows around another tree and eventually replaces it completely. 

The Strangler Fig Pattern in software modernization works similarly: the old system initially remains, while new functions are added step by step. Gradually, the new system takes on more tasks until it eventually fully replaces the old one

Strangler Fig Pattern vs. Strangler Pattern

Since 2019, the pattern is explicitly called Strangler Fig Pattern! This underlines the clear association with the Australian strangler fig. Unfortunately, the name Strangler Pattern also persists, which dilutes the metaphorical meaning and can thus be misleading. 

Through this gradual renewal, the application always remains functional. There are no abrupt failures or big surprises, which significantly minimizes risks and ensures a smooth transition. 

Do I Need Software Modernization? 

Find out now.

Big-Bang-Migration vs. Strangler Fig Pattern

“Have you tried turning it off and on again?” In software modernization, this approach is called Big-Bang Migration: old application off, new on

For many companies, Big-Bang Migration seems like the only viable option. The associated problems are seen as necessary evils that must be accepted to quickly shut down the old system and save costs. 

But anyone who has ever turned a device off and on again knows: This is not always the solution to all problems. Especially with Big-Bang Migration, there is often a “big bang” – complete chaos that ultimately stresses everyone. 

A much better question would be: “Have you switched over yet?” Because this is the desired result when you opt for the Strangler Fig Pattern. This repeatedly proven approach often runs so smoothly that no one even notices the switch from the legacy system to parallel operation. 

Expert Tip

The Strangler Fig Pattern can be applied in web, desktop, and mobile apps. It doesn’t matter whether the application is written in Java, JavaScript, COBOL, or VBA as part of an Excel sheet. The latter only requires more creative solutions. 

How Does the Strangler Fig Pattern Work? 

To recap: The Strangler Fig Pattern is a proven method for software modernization that aims to gradually replace old applications with new ones. But how exactly does the Strangler Fig Pattern work? Let’s look at the process in detail

1: Set Up Initial Switch 

In the first step, a switch is placed in front of the existing application. This switch will later direct requests to the old or new system. Initially, the switch directs all requests exclusively to the old system so that the modernization can begin in the background. 

How this switch exactly looks depends heavily on the form of the application. For websites, we can generally rely on existing reverse proxies or load balancers. For non-web-based applications, we often must become more creative and develop the switch individually. 

2: Doing The Switch 

In the next step, new functions are developed and tested. Once a new function is ready, the switch gets flipped. From then on, requests for this function are directed at the new application and no longer to the old one. This process occurs step by step so that the application is gradually modernized. 

The Strangler Pattern is used to renew old software or legacy systems step by step. The picture shows the incremental renewal of software using the strangler pattern. Small parts are renewed and the replaced part of the old software is switched off until something completely new has been created.

3: Continuous Integration 

During this process, the application always remains operable. Each new function is seamlessly integrated, ensuring uninterrupted availability to the application’s users. The modernization is continuous and transparent. 

4: Shutting Down the Old Application 

Once all obsolete functions have been replaced by new ones and all requests are directed to the modern version, the old application can be shut down. At this point, the modernization is complete. 

Advantages of The Strangler Fig Pattern 

The advantages of the Strangler Fig Pattern for businesses can be summed up in a few words: low risk, with quick returns. And that’s essentially all that needs to be said. 

We do, however, want to go into more detail on the most compelling aspects

Low-Risk Modernization 

We can’t emphasize it enough: The step-by-step renewal of the system ensures that the existing application remains functional throughout the entire process. This minimizes the risk of failures and unexpected problems. Additionally, companies can operate without interruptions. 

Flexibility and Cost Efficiency 

Companies can carry out the modernization at their own pace. They can set priorities and renew the most important functions first while less urgent parts of the system are tackled later. 

This also means cost efficiency: Instead of making large investments for a complete overhaul all at once, companies can spread the costs over a longer period. This eases budget planning and reduces financial burdens. 

Improved Maintainability and User Satisfaction 

By renewing the code step by step, it is gradually modernized and improved, significantly easing maintenance. Users also benefit from new functions and improvements without having to wait for the completion of the entire modernization. This way, they can gradually get used to the new system without being overwhelmed by facing too many alterations at once

Disadvantages of The Strangler Fig Pattern 

However, the Strangler Fig Pattern also brings challenges. Let’s take a closer look at these. 

Ensuring Data Integrity

A significant problem is data integrity, which is much more complex to manage here in comparison to the Big-Bang Migration. While data only needs to be transferred once with the Big-Bang approach, the Strangler Fig Pattern requires continuous synchronization of data between the existing and the new application. 

Risk of Premature Project Completion 

There is also the risk that the project may be terminated early once the most important functions are implemented in the new application. This can result in bug fixes and outdated libraries in the legacy system still needing maintenance and thus causing ongoing efforts. 

It is therefore essential to complete the project fully and migrate all functions to long-term benefit from the advantages of the Strangler Fig Pattern. 

When Is the Strangler Fig Pattern the Best Option?

Well, it depends! 

At MaibornWolff, for instance, software modernization always goes hand in hand with its own development. The reason behind this is to achieve a return on investment (ROI) as quickly as possible. To decide whether to use the Strangler Fig Pattern or another method, numerous factors need to be considered:

  1. How critical is the component now and how critical is it going to become after the technical change? 
  2. How clear is the technical understanding for the rebuild?  
  3. How strongly is the component linked when it comes to cutting? 
  4. How high is the technical debt? 

In the initial workshops, MaibornWolff addresses those questions together with you – in what is called the target model. This target model is continuously expanded and refined due to new technical and professional insights we collect during the modernization process. 

Tip

That was the quick explanation. If terms like “cutting,” “technical debt,” and “component” are not familiar to you, a more detailed explanation follows. This way, you can get a better understanding of the advantages the Strangler Fig Pattern provides. 

The Cutting Process in Detail 

To understand when using the Strangler Fig Pattern makes sense, we first need to explain the difference between replacing and transforming as well as the concept of cutting

Basically, a system can be modernized in two ways: by replacing or transforming it. 

  • Replacing means the old application is replaced by a new one. This can be done either in one single sweep or step by step, as in the Strangler Fig Pattern approach. 
  • Transforming means improving and adapting the existing code to bring it up to the latest standard. 
A system modernization is cut by the Strangler Pattern. In other words, it is broken down into individual parts. This image illustrates the procedure using Strangler Fig.

Which option to choose can only be determined by breaking the system into smaller parts. These parts are called components. The process of “breaking down” into components is called cutting. It works like this: 

  • pull apart: The code gets first pulled apart and then broken down into individual sections. 
  • cluster: These sections are then grouped according to their functions and relationships. 
  • divide sharply: Clear boundaries are then drawn between the different sections to separate them from each other. 

This enables us to look at the component level and ultimately, to decide on whether transformation or replacement is the more sensible choice in this case. 

Decision Criteria for the Strangler Fig Pattern

Should it be decided at this point to replace individual components, the choice is between Big-Bang Migration and the Strangler Fig Pattern. As already explained in detail, the Strangler Fig Pattern could be a suitable option in this case. 

Here are three scenarios: 

  • Outdated or poorly written components: In such cases, it is often more efficient to replace the old component with a new one instead of transforming it. 
  • Easily isolated components: If a component can be well insulated, it can be replaced more easily without affecting the rest of the system.
  • Clear understanding of new functions: We can replace the old component more efficiently, the more precisely we know how the new function is supposed to look. 

Tipp

Both the Big-Bang-Migration and the Strangler Fig Pattern are methods for replacing individual components at the system level. Of course, there are also approaches for modernization at the code level. If you want to learn more, we recommend you read our guide (in German) on the topic: “IT Renovation: Huge Changes in Baby Steps“. 

Jochen Schweizer – A Successful Use Case 

MaibornWolff has used the Strangler Fig Pattern over many years in various projects and has gained extensive experience. Additionally, we have developed tools such as CodeCharta, which allows us to precisely identify where, and which form of modernization should be chosen. This expertise not only saves you time but also costs. 

A successful demonstration of the Strangler Fig Pattern is the relaunch of the Jochen Schweizer shop by the Jochen Schweizer mydays Group (JSMDG). JSMDG faced the challenge of consolidating the technological systems of the merged companies Jochen Schweizer and mydays and developing a shared IT platform. 

To master this challenge, we relied on the Strangler Fig Pattern and built a centralized technology platform around the existing one. This centralized platform gradually replaced both the previous shops and the backend systems. The success of the project is evident in several areas: The new platform offers 100% availability without downtime, reduced load times by 37%, and a significantly higher conversion rate. Due to the modular architecture and self-developed core competences, JSMDG can respond agilely to market dynamics and is less dependent on external providers. 

Strangler Fig Pattern – The Low-Risk Method 

Imagine you own a ship that is replaced plank by plank over the years. The ship always remains seaworthy and is still continuously improved step by step. This philosophical approach is called the “Ship of Theseus.” It is also a much lesser-known name for the Strangler Fig Pattern. So, for your next software modernization, opt for the Ship of Theseus and remain seaworthy. 

FAQ about the Strangler Fig Pattern

The Strangler Fig Pattern is technically implemented by placing a switch in front of the existing application, which initially forwards all requests to the old system. As soon as a new function is ready, the switch gets flipped. So, from then on requests for this function are directed to the new application. The design of this switch depends on the form of the application and must be assessed on a case-by-case basis.

The main reasons for choosing the Strangler Fig Pattern are minimization of risks, continuous availability of the application, and the ability to carry out modernizations gradually and cost-effectively.