Problem Statement
Explain the Strangler Fig pattern for migrating from a monolith to microservices. How would you apply it safely?
Explanation
You place a routing layer in front of the monolith and peel off one capability at a time into a new service. The router sends only that capability’s traffic to the new service and keeps everything else on the monolith.
Run shadow traffic and canaries before switching real users. Keep a rollback path and common auth, logging, and metrics across both worlds so issues are visible and reversible.
Code Solution
SolutionRead Only
Gateway routes /payments/* → PaymentsSvc; rest → monolith
