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 Solutions Architect at AWS.

Read more from Fast Track To Cloud

Hello Reader, I have been a Cloud Solutions Architect for 10 years - 4 years at Verizon, 6.5 years at AWS. I was an Application Cloud Architect at Verizon, and then I joined AWS, where I had two different SA roles - first a General SA (Enterprise Architect) and then a Specialist SA. In this post, I will review my responsibilities as an SA in all these companies, including the hardest parts of the job (in my humble opinion). Let's get started: Solutions Architect at Verizon I became a SA at...

Hello Reader, In today's newsletter, I am going to share three tips that helped me and many of my students switch careers to the cloud and get high-paying jobs. I will also share an update about the upcoming Sep cohort of the AWS SA Bootcamp. Tip 1: Leverage your IT experience Your existing IT experience is NOT throwaway. Don't think you can't reuse components of your existing knowledge in your cloud journey. For example, my mentee and SA Bootcamper Rukmani, came from software engineering...

Hello Reader, In today’s post, let’s look at another correct but average answer and a great answer that gets you hired for common cloud interview questions. And this ties to a larger thread - most candidates fail their Solutions Architect interviews - not because they’re underqualified… But because they don’t know how to communicate like a Solutions Architect. How to stand out as a must-hire? Let's start with a common question, and we will go from there! Question - What's the difference...