Event-driven architectures

EventBridge, SQS vs SNS vs Kinesis, Step Functions, DLQs, idempotent consumers. Decoupling patterns that make serverless actually reliable.

About 32 min read3-question knowledge check

The mental model

Think about how a restaurant kitchen actually works. The waiter does not walk an order to the chef and then stand there waiting for the dish before taking the next table — they clip the ticket to a rail and move on. The chef pulls tickets when ready. The dishwasher, the bar and the dessert station all watch their own rails. Nobody blocks on anybody. If the dessert station falls behind, tickets pile up on its rail but the rest of the kitchen keeps running, and when it catches up it works through the backlog.

That ticket rail is a queue, the act of clipping a ticket is an event, and the fact that the waiter does not wait is asynchronous, decoupled communication. Event-driven architecture is running your whole system like that kitchen: components emit events about things that happened, other components react on their own schedule, and a buffer in the middle absorbs the mismatch in speed.

Why it exists: the alternative is synchronous request-response everywhere, where service A calls service B calls service C, and A cannot answer its user until the whole chain returns. That chain is only as available as its weakest link (if C is down, A fails), only as fast as its slowest hop, and it couples everyone's scaling together. Event-driven architecture breaks the chain: A drops an event and returns immediately, the buffer holds it, and B and C process when they can. You trade the simplicity of an immediate answer for resilience, independent scaling and loose coupling — which is exactly the trade that lets serverless systems survive their own bursts.

The one hard truth to internalise up front: asynchronous systems are eventually consistent and can deliver the same event more than once. Every design decision below is downstream of those two facts.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision