The Strangler pattern is a technique for gradually migrating a monolithic application to microservices by building new functionality as separate services and slowly redirecting traffic away from the old system, rather than rewriting everything at once.
Key Points: • New features or extracted functionality are built as standalone microservices instead of being added to the existing monolith. • A facade or routing layer sits in front of both systems, deciding whether each incoming request goes to the legacy monolith or a new microservice. • Old and new components run side by side during the migration, allowing thorough testing of new services against real traffic before fully cutting over. • Traffic is shifted incrementally, piece by piece, rather than in one risky "big bang" cutover. • Once no functionality remains routed to the monolith, it can be safely retired, having been gradually "strangled" by the new services surrounding it.
Example: A legacy retail platform might extract its "shopping cart" first as a microservice, route only cart-related requests to it through a facade, and continue routing checkout and inventory requests to the monolith until those are migrated in later phases.
Interview Tip: A concise interview answer is:
"The Strangler pattern replaces a monolith piece by piece — new functionality is built as microservices, a facade routes requests to either the old or new system, and traffic shifts gradually until the monolith has nothing left to do and can be decommissioned. It's much lower risk than a full rewrite because old and new can be validated side by side."