MESSAGING & EVENT-DRIVEN ARCHITECTURE / SYSTEM CONCEPT BRIEF

EventBridge

Amazon EventBridge is a serverless event bus.

IntermediatePhase 06 / Topic 7 of 18RequirementsTrade-offsFailure modes
01

Overview

Amazon EventBridge is a serverless event bus. Services publish events (JSON with source, detail-type, and detail) to a bus, and rules match events by content and route them to targets such as Lambda, SQS, Step Functions, API destinations, or other buses. It also receives events from AWS services and SaaS partners.

Compared with SNS, EventBridge offers rich content-based filtering, a schema registry, event archive and replay, cross-account buses, and scheduled rules (EventBridge Scheduler). It fits event-driven architectures where many producers and consumers integrate through a central bus.

A smart mail room

Every department drops letters into one mail room. Instead of sorting by address only, the clerk reads the contents and applies rules: invoices over $10,000 go to finance and audit, complaints go to support.

02

When to use it

  • Event-driven integration between many services or accounts.
  • Reacting to AWS service events (EC2 state change, S3 object created).
  • Integrating SaaS events (Shopify, Zendesk, Stripe via partners or API destinations).
  • Scheduled and cron-like tasks.
03

Where it shows up in interviews

Choreographed microservices

Recognize it when: services react to each other's events.

  • Design an event-driven e-commerce backend
  • Design order fulfillment on AWS
Operational automation

Recognize it when: react to infrastructure events.

  • Auto-remediate security findings
  • Tag new resources automatically
04

Where it is used in real software

AWS service events

GuardDuty findings, EC2 state changes, and CodePipeline events flow into EventBridge for automation.

SaaS partner sources

Partners like Auth0, Datadog, and Shopify send events directly to customer event buses.

EventBridge Pipes

Point-to-point integrations from sources like SQS, Kinesis, and DynamoDB Streams with filtering and enrichment.

05

Key terms

Event bus
Receives events; default, custom, and partner buses.
Rule / event pattern
JSON pattern matching event fields.
Target
Destination of matched events.
Archive and replay
Store events and resend them later.
Schema registry
Discovers and versions event schemas.
06

How it works, step by step

  1. 1
    Producer puts an event

    source, detail-type, and detail payload.

  2. 2
    Bus evaluates rules

    Content-based matching on any field.

  3. 3
    Matched targets are invoked

    With optional input transformation.

  4. 4
    Failures are retried

    Up to 24 hours, then a DLQ.

  5. 5
    Archive for replay

    Useful for debugging and backfills.

07

Event pattern matching

Rule: source = shop.orders, detail-type = OrderPlaced, detail.total >= 500

Step 1 / 4
EventMatches?Why
OrderPlaced total 750YesAll conditions met
OrderPlaced total 120NoTotal below 500
OrderCancelled total 900NoWrong detail-type
OrderPlaced from shop.testNoWrong source

NOWEvent: OrderPlaced total 750 | Matches?: Yes | Why: All conditions met

Routing logic lives in rules rather than in producers or consumers.

08

Implementation

{  "source": ["shop.orders"],  "detail-type": ["OrderPlaced"],  "detail": {    "totalCents": [{ "numeric": [">=", 50000] }],    "country": ["US", "CA"]  }}
09

Complexity and performance

Latency~hundreds of ms

Higher than SNS/SQS.

Event size256 KB

Per entry.

10

Trade-offs

Routing power vs latency

EventBridge offers rich rules and replay, with higher latency and cost per event than SNS.

Central bus governance

A shared bus simplifies integration but needs event schemas and ownership rules.

11

Variants and related techniques

EventBridge Scheduler

Managed cron and one-time schedules at scale.

Pipes

Source-to-target integrations with filtering and enrichment.

12

Common mistakes

  • Ignoring FailedEntryCount on PutEvents.

    Fix: Retry failed entries; the call can partially succeed.

  • Infinite loops.

    Fix: A target that emits events matching its own rule loops forever; scope rules carefully.

13

Interview questions

When would you choose EventBridge over SNS?

When you need content-based routing on event fields, many producers and consumers across accounts, AWS or SaaS events, archive and replay, or a schema registry, and can accept slightly higher latency.

How do you make EventBridge consumers resilient?

Target an SQS queue (or configure retries and DLQs), make handlers idempotent using event IDs, and archive events for replay.

14

Practice problems

ProblemDifficultyWhat it trains
Route high-value orders to a fraud checkEasyEvent patterns.
Design cross-account event-driven architectureHardBus topology.