Volume 10 · Chapter 4 — Messaging and Event-Driven Architecture

Event Buses with EventBridge

Goutham Mayaluri 8 min read AWSCloudEventBridgeMessaging

4.1 Introduction

SNS provides topic-based fan-out, but as event-driven systems grow you often want a richer event bus that can route events based on their content, connect many event sources and targets, and integrate across services and even SaaS applications. That’s Amazon EventBridge - a serverless event bus for building event-driven architectures. This chapter covers what EventBridge adds over plain pub/sub, its content-based routing, and where it fits, because choosing the right event-distribution service is a design and interview consideration.

4.2 What EventBridge Is

EventBridge is a serverless event bus that receives events from many sources - your applications, AWS services, and even third-party SaaS providers - and routes them to targets based on rules you define. Producers put events onto the bus, and rules match events (by their content) and send matching events to targets like Lambda functions, queues, or other services. Its distinguishing capability is content-based routing: rather than a subscriber getting everything on a topic, EventBridge rules inspect each event’s content and route only matching events to each target, so you express sophisticated routing declaratively. It’s also deeply integrated - many AWS services emit events to EventBridge automatically, and it can ingest SaaS events - making it a hub for event-driven integration across a whole estate.

flowchart TB
  S1[App events] --> Bus[(EventBridge bus)]
  S2[AWS service events] --> Bus
  S3[SaaS partner events] --> Bus
  Bus --> R1{Rule: payment events} --> T1[Lambda: fraud]
  Bus --> R2{Rule: high-value events} --> T2[Queue: manual review]
  Bus --> R3{Rule: account events} --> T3[Target service]
  Note[Rules route by event content] -.-> Bus

4.3 Content-Based Routing and Rules

EventBridge’s rules are the core feature. Each rule defines a pattern that matches events by their content - their type, fields, and values - and specifies targets to send matching events to. This means one bus can carry many kinds of events, and each rule picks out exactly the events relevant to its target: a rule might route all payment events to the fraud function, another route only high-value transactions to a manual-review queue, and another route account-change events to a different service. This declarative, content-based routing is more expressive than topic subscription with filtering - you define rich matching on the event payload and fan different events to different targets from a single bus, which keeps routing logic centralized and out of the producers and consumers.

4.4 EventBridge vs SNS/SQS

When do you use EventBridge versus SNS/SQS? SNS with SQS is excellent for straightforward fan-out of an event to a set of known subscribers with high throughput and per-consumer queues - a proven, simple, high-performance pattern. EventBridge shines when you need richer content-based routing (routing different events to different targets by rules), integration with many AWS services and SaaS sources that emit events to it, or a central event bus for a broader event-driven architecture. Roughly: reach for SNS/SQS for high-throughput fan-out to known consumers with durable queues, and for EventBridge when you want a flexible, rule-based event bus integrating diverse sources and routing by content. They’re complementary, and real architectures use each where it fits - EventBridge for the flexible routing hub, SNS/SQS for high-volume fan-out with buffering.

4.5 Schemas and Loose Coupling

As event-driven systems grow, the structure of events (their schema) becomes an important contract between producers and consumers, and EventBridge provides schema capabilities to help manage this. Well-designed events have a clear, stable schema so consumers can rely on their structure, and evolving that schema carefully (adding fields without breaking consumers) preserves the loose coupling that makes event-driven architecture extensible. The broader principle is that events are a contract: producers publish events with a defined shape, consumers depend on that shape, and managing event schemas thoughtfully - versioning, backward compatibility - is part of keeping a large event-driven system maintainable as it evolves and new producers and consumers are added.

4.6 Banking Production Scenario

A bank uses EventBridge as a central event bus for cross-service and cross-system integration. Application services, AWS services, and a SaaS fraud-intelligence provider all emit events to the bus. Rules route by content: all payment events go to the fraud-scoring function, high-value transactions are additionally routed to a manual-review queue, account-change events go to the notification service, and compliance-relevant events are routed to an audit pipeline. Because routing is centralized in rules, producers simply emit events without knowing consumers, and new routing is added by defining a rule rather than changing services. For high-throughput fan-out of its core “PaymentMade” event to several internal services with durable buffering, the bank still uses SNS-to-SQS - using each service where it fits, with EventBridge as the flexible integration hub.

4.7 Troubleshooting: Event Bus Problems

EventBridge issues usually involve routing or schema. Events not reaching a target mean the rule’s pattern doesn’t match the event content - check the rule pattern against the actual event structure. Wanting different events to go to different targets but using a single topic means you need EventBridge’s content-based routing rather than plain pub/sub. Routing logic scattered across services means it should be centralized in bus rules instead. Consumers breaking when an event’s structure changes means the schema was evolved incompatibly - version schemas and keep changes backward-compatible. Needing to integrate a SaaS or many AWS service events points to EventBridge as the right hub. Choosing EventBridge for simple high-throughput fan-out to known consumers may add needless complexity where SNS/SQS suffices. The discipline is matching the tool to the need - EventBridge for rule-based routing and integration, SNS/SQS for fan-out with buffering - and managing event schemas as contracts.

Interview Question

What does EventBridge add over SNS/SQS, and when would you choose each?

EventBridge is a serverless event bus that adds richer, content-based routing and broad integration over the simpler fan-out that SNS and SQS provide. With SNS/SQS, a publisher sends to a topic and every subscriber (each typically backed by its own SQS queue) gets a copy, which is a proven, simple, high-throughput way to fan an event out to a set of known subscribers, each with a durable queue for buffering, independent processing, and dead-letter handling. EventBridge works differently: producers put events onto the bus, and rules match events by their content and route only matching events to targets like Lambda functions, queues, or other services. Its distinguishing capabilities are content-based routing, integration, and centralized routing logic. Content-based routing means each rule defines a pattern matching events by their type, fields, and values, so one bus can carry many kinds of events and route different events to different targets - all payment events to the fraud function, only high-value transactions to a manual-review queue, account-change events to another service - which is more expressive than topic subscription with simple filtering. Integration means EventBridge natively receives events from many AWS services and even third-party SaaS providers, making it a hub for event-driven integration across a whole estate. And because routing lives in the bus’s rules, the routing logic is centralized and kept out of producers and consumers, so you add new routing by defining a rule rather than changing services. So I choose between them based on the need: I use SNS with SQS for straightforward, high-throughput fan-out of an event to a set of known subscribers where I want each consumer to have its own durable, independently-scaled queue - a simple, high-performance, proven pattern, ideal for something like distributing a core “PaymentMade” event to several internal services. I use EventBridge when I need richer content-based routing that sends different events to different targets by rules, when I need to integrate many AWS services or SaaS sources that emit events, or when I want a central, flexible event bus for a broader event-driven architecture. They’re complementary rather than competing, and real systems use each where it fits - EventBridge as the flexible, rule-based integration hub and SNS/SQS for high-volume fan-out with per-consumer buffering. I’d also note that as event-driven systems grow, event schemas become contracts between producers and consumers, so managing them carefully - stable, versioned, backward-compatible - is important to preserve loose coupling, and EventBridge offers schema capabilities to help with that. So EventBridge adds content-based routing, wide integration, and centralized rules over SNS/SQS’s simpler high-throughput fan-out, and I match the tool to whether I need flexible routing and integration or straightforward buffered fan-out.

Chapter Revision Notes

  • EventBridge is a serverless event bus: producers emit events, rules match by content and route to targets - content-based routing.
  • It integrates many sources (your apps, AWS services, SaaS) and centralizes routing logic in rules, keeping producers/consumers decoupled.
  • Use SNS/SQS for simple high-throughput fan-out to known subscribers with durable queues; EventBridge for rule-based routing and broad integration.
  • They’re complementary - EventBridge as the flexible hub, SNS/SQS for buffered fan-out - used where each fits.
  • Event schemas are contracts; version them and keep changes backward-compatible to preserve loose coupling as the system grows.