Stop 08 · Serverless & Event-Driven ArchitectureTopics · 6/9

Event Buses (EventBridge)

Part of the Cloud Computing Roadmap

In short

Once five services publish events and eight want to listen, wiring each pair by hand becomes a mess. An event bus is the one place everyone publishes to, with rules deciding who gets what.

A more flexible event routing service that lets multiple event sources and consumers connect via rules, without every producer needing to know about every consumer directly.

The blob character sorts envelopes into wooden pigeonholes in a post office.

Think of it like this

The post office sorting room

Senders drop letters in one box. Inside, the sorter reads each address and drops it in the right bag: Delhi, Chennai, local. Senders never learn the routes. Add a new town and you add a bag, not new post boxes.

Watch it happen

One event, routed by rules

orders bus
Rule: all orders
Rule: total>1000
Rule: cancelled
Email Lambda
Analytics queue
Fraud check
Refund Lambda

1/5Checkout publishes OrderPlaced with total 1499 to the bus. It knows nothing about targets.

The big ideas

What you need to know

Pattern matching

Rules match on fields like source, detail-type and values inside detail, including numbers and prefixes.

Fan out

One event can match many rules, and each rule can send to several targets.

Built-in sources

Many AWS services and some SaaS partners publish events to EventBridge for you to react to.

Schedules too

EventBridge Scheduler runs targets on cron or one-time schedules without a server.

See it in code

Walk through the code

json
1{2  "source": ["campus.checkout"],3  "detail-type": ["OrderPlaced"],4  "detail": {5    "total": [{ "numeric": [">", 1000] }]6  }7}

1/2Match only OrderPlaced events from our checkout service.

An EventBridge event pattern for the fraud rule. Any field not mentioned is ignored when matching.

Save yourself the pain

Common mistakes

Oops

Using a bus when one service simply needs a reply from another.

Do this instead

Buses suit fire-and-forget facts. If you need an answer back right now, call an API.

Oops

Changing an event's shape without telling consumers.

Do this instead

Treat event schemas like an API contract. Add fields, don't rename or remove them silently.

Your mission

Route a test event

~30 min

Quick check

What's the main difference between an SQS queue and an event bus?

Go deeper

  1. 1Set up a basic event bus rule routing an event to a target based on a pattern.
  2. 2Learn how this differs from a simple queue: many-to-many routing versus a linear pipe.
  3. 3Understand why this pattern scales better as the number of event types and consumers grows.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge