Architecture Patterns : Strangler Pattern

Pier-Jean Malandrino
Scub-Lab
Published in
5 min readNov 6, 2023

--

What is Strangler Pattern?

The Strangler Pattern, first described by Martin Fowler, is a software architectural pattern that describes a method of gracefully migrating a legacy system incrementally, rather than in a big bang approach. It is named after the Strangler Fig, a type of vine that slowly grows on a tree and eventually replaces it. Similarly, in the software context, the Strangler Pattern involves building a new system around the boundaries of the old system, allowing you to slowly replace parts of the old system with components of the new system over time. Many Software engineers will be confronted to system migration in their career, the technolgy growing faster, humans need time to adapt and to maintain their system, that can became old sometimes even before they have time to finish it. The strangler pattern is an approach that allow migration without a big bang, which can be very stressfull for teams and is often condamned to failure. My own view is that this pattern is very efficient in the context of large systems, because it allows people to gain confidence in the ability to make the migration, providing a multitude of small successes that are much harder to achieve in a one-shot.

The general approach is to identify areas of the old system that can be replaced, and then gradually route new requests or functionality to the new system while the old system still handles the legacy functionality. Over time, as the new system becomes more robust and feature-complete, more and more functionality is transitioned over, until the old system can be safely retired.

Benefits

Incremental Migration

Instead of a high-risk, big bang release, you can migrate to the new system step by step, ensuring that the new components work properly before moving on.

Reduces Risk

By breaking down migration into smaller, manageable chunks, it reduces the risk associated with major changes.

Maintain Business Continuity

Throughout the migration process, the business can continue to operate using the existing system, ensuring that there’s no loss of functionality or downtime.

Facilitates Modernization

This pattern is particularly useful when transitioning from monolithic architectures to microservices, as you can gradually replace monolithic components with microservices.

Flexibility

Since the migration happens over time, it allows teams to adjust and refine their approach based on feedback from earlier migration stages. It is also suitable for use with modern software development methods such as Agile iterative methods.

Parallel Development

While the new system is being developed, changes can still be made to the old system if necessary.

Stakeholder trust

Migrations are often a big deal for IT teams, especially because they represent a large investment with an ROI that can be difficult to measure. If accepted, small signs of dysfunction can make everyone very worried because of the high risk situation from their point of view. In a sort of strangler pattern, with smaller chunks, the stress could be much more localised to a particular chunk or a bunch of chunks. That helps a lot to manage stress at a C level.

Focus on business value

By only migrating small parts, you can focus on the most important parts or those that will benefit the most from the migration. In this way, by migrating small parts of a monolithic system, you can enable complete new business for your company, simplify some critical points, etc.

Trade-offs

Complexity

Managing two systems simultaneously can be complex. Ensuring compatibility, routing requests, and maintaining state between the two can be challenging.

NB: Consider the case of an old system with executables and multiple local databases living alongside a modern centralised web application. Coordinating and versioning the databases will be very challenging.

Resource Intensive

Both the old and new systems might need to run concurrently, requiring additional infrastructure and maintenance resources.

Potential for Drift

As development progresses, there’s a risk that the new system might drift in terms of features or functionality from the old one, especially if changes continue to be made to the legacy system.

Duration

The transition can be lengthy, especially for large, deeply integrated systems. This prolonged transition period can lead to increased costs and resource allocation for the migration.

Team Alignment

The team needs to be aligned in terms of goals, understanding of the legacy system, and the migration strategy to ensure successful implementation of the Strangler Pattern.

Conclusion

The Strangler Pattern emerges as a compelling approach for managing the evolution of software systems in a world where change is the only constant. By allowing for the gradual replacement of components of a legacy system, this pattern offers a strategic roadmap for organizations navigating the complexities of technological advancement.

The incremental nature of the pattern aligns well with contemporary Agile practices, affording teams the ability to adapt, inspect, and adjust throughout the migration process. This not only maintains business continuity but also helps in cultivating stakeholder trust by demonstrating consistent progress and reducing the anxiety associated with large-scale system overhauls.

However, the Strangler Pattern is not without its challenges. The complexities inherent in running and gradually transitioning between two systems should not be underestimated. It demands a disciplined approach to coordination, comprehensive testing, and a keen eye for maintaining feature parity where needed.

The key to a successful Strangler Pattern implementation lies in meticulous planning, clear communication, and a phased approach to deployment that prioritizes business value. It is an exercise in balance — between old and new, speed and stability, and investment versus return.

As software engineers, the Strangler Pattern equips us with a pragmatic framework for ensuring that our systems can evolve without disrupting the vital services they provide. In the lifecycle of software, the Strangler Pattern is not merely a method for system migration — it is a manifestation of the evolutionary nature of technology itself. It’s about ensuring that as our software matures, it can continue to support the ever-changing landscape of business needs, remaining robust, relevant, and resilient in the face of change.

I am the CTO and Head of an architectural unit in a digital company. I participate in the development of technological strategy, design solutions, and lead R&D projects.

Thank you for reading! If you enjoyed this article, please feel free to 👏 and help others find it. Please do not hesitate to share your thoughts in the comments section below.

Scub Lab

Thank you for being a part of our community! Before you go:

--

--

CTO & Head of Architecture at a digital firm, I drive technological strategy, design innovative solutions, & lead R&D projects.