Strangler Fig with serverless and an event bus
applying incremental migration with serverless.
API Gateway acts as the routing facade, new features run as Lambda functions, an event bus decouples and fans out to new services, and traffic shifts feature by feature until the monolith…
WHAT THIS TESTS This checks whether you can translate an abstract migration pattern into concrete serverless components and evolve toward event-driven architecture incrementally.
A GOOD ANSWER COVERS Recap the pattern: gradually replace the monolith behind a routing facade. In serverless terms, API Gateway is that facade. It sits in front of the legacy app and, for each route, either proxies to the monolith or invokes a new Lambda function that reimplements that feature. Initially almost everything goes to the monolith; you move features one at a time by repointing routes to Lambdas. To introduce event-driven decoupling, have the monolith or the new functions publish domain events to an event bus such as EventBridge. Consumers, additional Lambdas, subscribe to events and react asynchronously, so new capabilities attach without the monolith calling them directly. Over time more routes and more logic shift to serverless and events, and the monolith shrinks until it is retired. Address shared data and event-schema versioning during coexistence.
COMMON WRONG ANSWERS A one-shot rewrite into Lambdas with a single cutover. Omitting API Gateway, so there is no clean interception point. Skipping the event bus and tightly coupling new functions to the monolith. Ignoring shared data access between old and new systems.
LIKELY FOLLOW-UPS How do you publish events from a legacy monolith that knows nothing about EventBridge? How do you version event schemas? How do you handle the shared database? How do you roll back a migrated route?
ONE CONCRETE EXAMPLE A monolithic order app sits behind API Gateway. The team builds a new Lambda for /notifications and routes that path to it; the monolith publishes an OrderPlaced event to EventBridge, which fans out to the notification Lambda and a new analytics Lambda. Each sprint they migrate another route and emit more events, until API Gateway no longer forwards anything to the monolith and it is shut down.
Interview question
In a serverless Strangler Fig migration, what role does an event bus like EventBridge play?
- a.It decouples new services by fanning out domain events to consumers without direct calls from the monolithCorrect
- b.It replaces API Gateway as the request router
- c.It stores the legacy application's primary database
- d.It performs the final big-bang cutover automatically
Why? this is the answer
The event bus enables event-driven decoupling, letting new Lambdas react to published events instead of being invoked directly by the monolith. API Gateway remains the request facade, the bus is not a database, and migration stays incremental rather than big-bang.
Just read this? Test yourself on what you have been reading.
Read the original → dev.to
- #strangler-fig
- #serverless
- #event-driven
- #api-gateway
- #migration
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles