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.
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.
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.
Where it shows up in interviews
Recognize it when: services react to each other's events.
- Design an event-driven e-commerce backend
- Design order fulfillment on AWS
Recognize it when: react to infrastructure events.
- Auto-remediate security findings
- Tag new resources automatically
Where it is used in real software
GuardDuty findings, EC2 state changes, and CodePipeline events flow into EventBridge for automation.
Partners like Auth0, Datadog, and Shopify send events directly to customer event buses.
Point-to-point integrations from sources like SQS, Kinesis, and DynamoDB Streams with filtering and enrichment.
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.
How it works, step by step
- 1Producer puts an event
source, detail-type, and detail payload.
- 2Bus evaluates rules
Content-based matching on any field.
- 3Matched targets are invoked
With optional input transformation.
- 4Failures are retried
Up to 24 hours, then a DLQ.
- 5Archive for replay
Useful for debugging and backfills.
Event pattern matching
Rule: source = shop.orders, detail-type = OrderPlaced, detail.total >= 500
| Event | Matches? | Why |
|---|---|---|
| OrderPlaced total 750 | Yes | All conditions met |
| OrderPlaced total 120 | No | Total below 500 |
| OrderCancelled total 900 | No | Wrong detail-type |
| OrderPlaced from shop.test | No | Wrong source |
NOWEvent: OrderPlaced total 750 | Matches?: Yes | Why: All conditions met
Routing logic lives in rules rather than in producers or consumers.
Implementation
{ "source": ["shop.orders"], "detail-type": ["OrderPlaced"], "detail": { "totalCents": [{ "numeric": [">=", 50000] }], "country": ["US", "CA"] }}Complexity and performance
Higher than SNS/SQS.
Per entry.
Trade-offs
EventBridge offers rich rules and replay, with higher latency and cost per event than SNS.
A shared bus simplifies integration but needs event schemas and ownership rules.
Variants and related techniques
Managed cron and one-time schedules at scale.
Source-to-target integrations with filtering and enrichment.
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.
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.
Practice problems
| Problem | Difficulty | What it trains |
|---|---|---|
| Route high-value orders to a fraud check | Easy | Event patterns. |
| Design cross-account event-driven architecture | Hard | Bus topology. |