Hello Reader, The two most prominent architecture patterns are microservices and Event-Driven Architecture (EDA). Let’s examine their differences and implementations, with the architecture diagram below: Request Response FlowTraditional microservice is synchronous i.e. the request and response happens on the same invocation. For example, if you are inserting data into the backend database using a microservice as shown in the left diagram, the invocation from the user will stay active till the Lambda inserts the info into the database, replies success back to the API Gateway, and API Gateway sends the response back to the user. Whereas with Event Driven, User gets a confirmation that the message is inserted into an event storage/processing service (SQS in this case) using the API Gateway. But he doesn’t get the response from the Lambda, which is inserting the message into the database, on the same invocation. Instead, the backend Lambda needs to send the response out after the message has been inserted into the database if the user needs to be notified. In this case the Lambda is invoking a websocket API, to notify the user. Alternatively, the user can query the status of the message independently using a separate microservice. Scaling (Important!)In a microservice, all the components (API Gateway, Lambda, Dynamo) need to scale up and down at the same rate. When traffic increases, all these three components will scale up together. However, if concurrent traffic exceeds a threshold beyond a service, let’s say Dynamo or Lambda max concurrency limit, transaction will fail. With EDA, the producer and consumer are decoupled. API Gateway, and Lambda/Database can scale independently. When traffic increases, API Gateway can scale up and insert messages into the SQS. However the backend Lambda and Dynamo are protected from this burst. Lambda can consume messages at a rate not to overwhelm the database. This also leads to EDA being more cost effective. Retry MechanismIf a microservice transaction fails, the user needs to send the request again. There is no default retry mechanism. With EDA, once the message is in SQS, even if Lambda fails, SQS will automatically retry to reprocess the messages. ConclusionSo which one is better? Well, as always, the answer is “it depends”! EDA can handle higher scale, and is generally more cost effective than synchronous microservice. However, in some cases you need a traditional synchronous microservice. In most applications, microservice and EDA can work together. There are parts of applications that can be broken down to be EDA. As we architects like to say, it’s NOT all or nothing, instead it’s the right tool for the right job. AWS Solutions Architect Interview MistakesAs a veteran interviewer, I see these mistakes costing candidates the offer. I explained these common (yet secret!) errors with actual questions and answers in this video: If you have found this newsletter helpful, and want to support me 🙏: Checkout my bestselling courses on AWS, System Design, Kubernetes, DevOps, and more: Max discounted links AWS SA Bootcamp with Live Classes, Mock Interviews, Hands-On, Resume Improvement and more: https://www.sabootcamp.com/ Keep learning and keep rocking 🚀, Raj |
Free Cloud Interview Guide to crush your next interview. Plus, real-world answers for cloud interviews, and system design from a top Solutions Architect at AWS.
Hello Reader, Gen AI hype is at an all-time high, and so is the confusion. What do you study, how do you think about it, and where are the most jobs? These are the burning questions in our minds. I love first-principles thinking, which means breaking down a problem into the smallest logical chunks, and I approach Gen AI the same way. Gen AI can be broken down into the following four layers: The bottom layer is the hardware layer, i.e., the silicon chips that can train the models. Example -...
Hello Reader, Becoming an AWS Community Builder is both prestigious and significantly increases your chances of being picked up by recruiters for an interview. In today's newsletter, my mentee Vijay, Principal Engineer at Nokia, will detail the steps so YOU can become an AWS Community Builder as well. Off to you Vijay.. Hi, Vijay here 👋! In March 2025, I got into AWS Community Builders Program. Many people reached out to me to know how to get into the program. Here is a detailed article on...
Hello Reader, Are you thinking about becoming an AWS SA and working at top companies? Data shows that Solution Architects earn between $200,000/year and $500,000+/year (screenshots below). The demand for AWS Solutions Architects has never been higher and will continue to rise because there are literally trillions of dollars worth of projects currently running on legacy technologies that need to be migrated to the cloud. If you’ve ever looked into becoming an SA on your own, you were likely...