Event Driven Architecture (EDA) Crash Course


Hello Reader,

EDA (Event Driven Architecture) has become increasingly popular in recent times. In this newsletter edition, we will explore what is EDA , what are the benefits of EDA, and then some advanced patterns of EDA. Let's get started:

An event-driven architecture decouples the producer and processor. In this example producer (human) invokes an API, and send information in JSON payload. API Gateway puts it into an event store (SQS), and the processor (Lambda) picks it up and processes it. Note that, the API gateway and Lambda can scale (and managed/deployed) independently

Benefits of an event-driven architecture:

  1. Scale and fail independently - By decoupling your services, they are only aware of the event router, not each other. This means that your services are interoperable, but if one service has a failure, the rest will keep running. The event router acts as an elastic buffer that will accommodate surges in workloads.
  2. Develop with agility - You no longer need to write custom code to poll, filter, and route events; the event router will automatically filter and push events to consumers. The router also removes the need for heavy coordination between producer and consumer services, speeding up your development process.
  3. Audit with ease - An event router acts as a centralized location to audit your application and define policies. These policies can restrict who can publish and subscribe to a router and control which users and resources have permission to access your data. You can also encrypt your events both in transit and at rest.
  4. Cut costs - Event-driven architectures are push-based, so everything happens on-demand as the event presents itself in the router. This way, you’re not paying for continuous polling to check for an event. This means less network bandwidth consumption, less CPU utilization, less idle fleet capacity, and less SSL/TLS handshakes.

Now that we understand the EDA basics, let's take a look at a couple of advanced EDA patterns:

API Gateway + EventBridge Pattern

  1. API Gateway directly posts a message into an EventBridge event bus. Event buses are routers that receive events and delivers them to one or more targets. Event buses are well-suited for routing events from many sources to many targets, based on rules, from delivery to target.
  2. One example could be an insurance company that deals with auto, home, and boat insurance. The API is invoked by the user, which puts a message on the event bus. One field in the message determines if the message is for auto, or home, or boat insurance. EventBridge can have the rules based on the value of this field and then trigger different targets accordingly. For example, it triggers Lambda1 for auto, Step Function for home, and Lambda2 for boat insurance
  3. EventBridge can also archive the messages for testing and replay, and even transform the messages!

SNS + SQS Pattern

This pattern is similar to the previous one but has some differences:

  1. Here, SNS routes messages to different SQS queues. SNS message destination filter, or filter policy, allows subscribers to receive only a subset of messages published to a topic. This can be done using message metadata (attributes attached to the message and NOT the fields in the message), or message fields (only for SNS FIFO topics)
  2. We have separate queues for separate messages. One burning question is, why do I need the queue in between? SNS throughput can be very high and exceed the consumption rate of the processor service (Lambda or EKS in this case) causing in throttling and errors. Introducing a queue ensures that the end processor can consume the messages at a preset rate. Also, as we learned before, with SQS, retries are built in!
  3. Each queue can be processed by different targets - Lambda, EKS, and others.

If you want to know about SNS Vs SQS Vs EventBridge in detail, check out this video.

Now, you are equipped to handle even tough interview questions on EDA! Make sure to practice, and crush your cloud interview 🙌

Get 25% off the Zero to Hero with serverless

A friend of this newsletter, Yan Cui (AWS Serverless Hero), is running a serverless workshop and has kindly offered us a 25% discount!

Production-Ready Serverless workshop is a hands-on deep dive into everything you need to build serverless architectures for the real world — from system design, testing, CI/CD, cost optimizations, observability, and more. If you want to get serious about serverless and learn from one of the best, this workshop is for you. Learn more at productionreadyserverless.com. Use exclusive discount code 46JEBDF to get 25% off.

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

Fast Track To Cloud

Free Cloud Interview Guide to crush your next interview. Plus, real-world answers for cloud interviews, and system design from a top AWS Solutions Architect.

Read more from Fast Track To Cloud

Hello Reader, In today’s post, let’s look at another correct but average answer and a great answer that gets you hired to common cloud interview questions. This question is even more relevant now, after this week's AWS outage! Question - How did you do Disaster Recovery (DR) for your AWS application? Common but average answer - I will replicate it to another region What the interviewer is looking for is how DR strategies are chosen, and what are the different strategies. As an SA, you will be...

Hello Reader, Recently, I had the privilege of speaking to the Computer Science and Business Club at Rutgers University - ranked #1 in New Jersey for Engineering and Computer Science by U.S. News & World Report. It was incredible to see how driven and curious these students were. Many already had offers from Amazon, JPMorgan, and other top companies. Talking with them took me right back to my college days - studying for exams, chasing grades, and trying to figure out how to land that first...

Hello Reader, Another week, another AI announcement. But this one is worth studying because this one will become the defacto standard of running agents on AWS. I am talking about newly released Amazon AgentCore. Let's dive in. 🧩 The Big Picture: Why Agents Exist Let’s break it down using a practical example: What happens when a user asks an LLM app: What’s the time in New York? What’s the weather there? List my S3 buckets The LLM don't have these information, hence it needs to invoke tools...