The need to add new features and functionality to legacy systems is always present - over time it can become continually harder to do this. Additionally, these systems are often built using old tools, SDKs, hosted on outdated platforms, or potentially have increasingly complex (or obsolete) architectures - these all contribute to make is harder to maintain the systems in the first place.
At some point, it becomes necessary to take the existing legacy system and update it to a more modern architecture using newer tools and technologies.
Without focusing on the specific technology - there are 3 main approaches to modernizing applications:
Lock the developers into a room and shove some pizza under the door... and don't let them out until the application is modernized! Whilst this is a bit of a joke, it is a valid approach to modernizing applications. The idea is to take the existing application and rewrite it from scratch using the latest technologies and tools. This is a valid approach if you have a small application that is not complex and you have the time and budget to do this.
🙂 Figure: OK example - big bang migration
The idea is to take the existing application and incrementally update it to a more modern architecture. This is a better approach if you have a large application that is complex and you have the time and budget to do this.
🙂 Figure: OK example - evolutionary migration (fitting a square peg in a round hole)
Strangler Fig pattern was first described by Martin Fowler in 2004. The strangler fig is a type of tree that grows around other trees and slowly kills them by strangling them. This is exactly what this pattern does.
Figure: an actual strangler fig strangling a tree
The idea is to create a "new" application (with a modern architecture) that acts as a facade to the existing application - then port features bit by bit to the new/modern architecture. Once slices of functionality have been ported and are ready - re-point the facade to execute the new code. You can trigger this through feature flags and this also allows you to rollback to the old code if something goes wrong.
Looking to incrementally update an ASP.NET application? Read about using YARP and Incremental ASP.NET to ASP.NET Core Migration
It's a language & platform agnostic approach that can be applied to any application.
Microsoft have a great article on the strangler fig pattern - Strangler Fig Application.
It works for AWS too - Strangler Fig Application.
✅ Figure: Good example - strangler fig pattern in action during a migration
Tip: this pattern can be used when migrating websites to a new architecture. You can place Azure Front Door in front of the existing website. Once a page (or route) on the new website is ready - you can re-point that page in Front Door to the new website.
Campion was able to move from a monolithic application to microservices whilst still continually deploying code to production by leveraging the Strangler Fig pattern. Watch at 28:00