SysPadLessons › messaging lessons › EventBridge

How EventBridge works

Serverless event bus connecting AWS services, SaaS apps, and custom applications. Rules route events to Lambda, SQS, Step Functions, and more. Delivery is durable and typically sub-second, not sub-millisecond - it is a bus, not a function call.

SNS routes by topic: subscribe and you get everything on it. EventBridge routes by what the event actually says. Rules peer inside the event’s JSON and send only matching events to specific targets, and it speaks fluently with dozens of AWS services and SaaS tools out of the box. It’s the central nervous system of an event-driven AWS app.

What you will learn

An event bus, not a topic

An event is JSON describing something that happened. Producers put events on an event bus; EventBridge decides where each one goes. The default bus already receives events from many AWS services; you can add custom buses for your own app and connect SaaS partner sources too.

Rules and event patterns

A rule has an event pattern, a JSON template matched against incoming events (e.g. only orders where amount > 100 from source: "orders"). Matching events are routed to the rule’s targets.

One event can match several rules and hit several targets; one rule can have multiple targets. This content-based routing is richer than SNS’s attribute filters.

Great for choreographing microservices and reacting to AWS state changes (e.g. an EC2 instance entering a state, an S3 object created).

What can be a target, and is there scheduling too?

Targets include Lambda, Step Functions, SQS, SNS, Kinesis, API destinations (any HTTP API), and other buses, dozens in all. EventBridge Scheduler also fires events on a cron/rate schedule, so it doubles as a serverless cron for triggering workflows.

Batteries included: AWS + SaaS integration

EventBridge’s superpower is reach. AWS services emit events to it natively, and partner event sources (Datadog, Zendesk, Shopify, and more) deliver SaaS events straight onto a bus, no polling glue to maintain.

EventBridge vs SNS

Use EventBridge when you need content-based routing, many AWS/SaaS integrations, scheduling, or event archive and replay. Use SNS when you just need fast, simple, high-throughput fan-out to a few subscribers (and especially very high message rates at low latency).

Flashcards

How does EventBridge routing differ from SNS topic routing?
EventBridge matches event content (JSON patterns) to route to targets; SNS delivers everything on a topic to its subscribers.
What makes a rule fire and where does the event go?
The event matches the rule’s event pattern; EventBridge then sends it to the rule’s targets (Lambda, Step Functions, SQS, etc.).
Why is EventBridge handy for reacting to AWS service activity?
AWS services emit events to it natively (plus SaaS partner sources), so you react to state changes with no polling glue.
You need to re-run last week’s events through a new consumer. What EventBridge feature?
Archive and replay, EventBridge can store events and replay them to targets later.
When is SNS the better pick than EventBridge?
For simple, very high-throughput, low-latency fan-out without content-based routing, SNS is leaner and typically cheaper.

Sources

Open the SysPad canvas · Official EventBridge documentation

Other messaging lessons