This is part of a series of Monolith to Microservices Migration Patterns.
Microservices have been getting more and more popular in recent years, and several companies are migrating monolithic applications to microservices. But just a reminder that switching to microservices might not always be the good option. Martin Fowler wrote a nice article regarding the monolith-first approach. Here are a couple of useful statements:
- Almost all the successful microservice stories have started with a monolith that grew too big and was broken up.
- Almost all the cases I’ve heard of a system that was built as a microservice system from scratch, it has ended up in serious trouble.
A migration technique that has been frequently used when doing system rewrites is called the Strangler Fig Application. This migration method is based on incrementally replacing existing functionalities of the old legacy system with new applications and services in a phased approach until the new application system eventually replaces all of the old legacy system’s features.
The name of this type of tree, the Strangler Fig, comes from their pattern of growth around the host tree, which often results in the host’s death. The roots grow down to the forest floor where they take root and begin to take nutrients from the soil. Gradually the roots wrap around the host tree, widen, and slowly form a lattice-work that surrounds the host’s trunk. The fig’s crown grows foliage which soon overshadows the tree. Eventually, the host tree dies leaving the fig with a hollow trunk.
Martin Fowler chose this as the name of the pattern as a metaphor of describing a way of doing rewrite of an important system. Our new system is initially supported by and wrapping the existing system. The old and the new can co coexist while the new system can grow and potentially replace the entire old system.
“An alternative route is to gradually create a new system around the edges of the old, letting it grow slowly over several years until…