Q: What is Amazon EventBridge and how does it differ from SNS?
Amazon EventBridge is a serverless event bus that routes JSON events from AWS services, your applications and SaaS partners to targets using content-based rules, while SNS is a high-throughput pub/sub topic that pushes each.
Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: <strong>Amazon EventBridge</strong> is a serverless event bus that routes JSON events from AWS services, your applications and SaaS partners to targets using content-based rules, while SNS is a high-throughput pub/sub topic that pushes each message to its subscribers. The key difference between EventBridge and SNS is routing intelligence versus raw fan-out: EventBridge matches rich patterns on event content, supports schema discovery, archive and replay, whereas SNS excels at simple, fast fan-out and endpoints like SMS, email and mobile push. Interviewers ask this to see whether you can pick the right messaging primitive for event-driven architecture rather than defaulting to SNS for everything.
Mental model: event bus with rules vs topic with subscriptions
Both decouple producers from consumers, but they differ in where routing decisions live.
- EventBridge: producers put events on a bus; rules with event patterns decide which targets receive each event. Rules can match on any field in the JSON body, including nested values and numeric ranges.
- SNS: producers publish to a topic; every subscription gets the message unless a filter policy (on message attributes, or on the payload if configured) excludes it.
- Event sources: the default EventBridge bus receives events from AWS services (EC2 state changes, CodePipeline, GuardDuty and more) automatically; SNS only carries what you publish.
- Extra features unique to EventBridge: schema registry, archive and replay, event buses across accounts and regions, SaaS partner buses, API destinations, Pipes and Scheduler.
- Typical examples: 'when a GuardDuty finding has severity above 7, start a Step Functions workflow' is natural in EventBridge; 'text the on-call phone when an alarm fires' is natural in SNS.
Hands-on: Amazon EventBridge rules and put-events
Create a bus rule matching on payload content and send a test event.
aws events create-event-bus --name orders-bus
aws events put-rule --event-bus-name orders-bus --name big-orders \
--event-pattern '{"source":["my.app.orders"],"detail-type":["OrderPlaced"],"detail":{"total":[{"numeric":[">",1000]}]}}'
aws events put-targets --event-bus-name orders-bus --rule big-orders \
--targets '[{"Id":"fraud-queue","Arn":"arn:aws:sqs:us-east-1:111122223333:fraud-review",
"DeadLetterConfig":{"Arn":"arn:aws:sqs:us-east-1:111122223333:eb-dlq"}}]'
aws events put-events --entries '[{"EventBusName":"orders-bus","Source":"my.app.orders",
"DetailType":"OrderPlaced","Detail":"{\"id\":\"42\",\"total\":1500}"}]'
- Pattern first: test it with
aws events test-event-patternbefore wiring targets. - Targets: add Lambda, SQS, Step Functions, ECS tasks, API destinations and many other services. Give each target a dead-letter queue and a retry policy.
- Permissions: Lambda needs a resource-based permission for
events.amazonaws.com; other targets use an IAM role specified on the target. - Custom events: use a source name you own, for example
my.app.orders, and a stabledetail-type. - Verify end to end: after put-events, check the rule's
InvocationsandFailedInvocationsmetrics and read the target queue or function logs to confirm the event arrived with the expected shape.
Archive, replay and schema discovery
Features that make EventBridge suited to evolving event-driven systems.
aws events create-archive --archive-name orders-archive \
--event-source-arn arn:aws:events:us-east-1:111122223333:event-bus/orders-bus \
--retention-days 30
aws events start-replay --replay-name fix-2026-10 \
--event-source-arn arn:aws:events:us-east-1:111122223333:archive/orders-archive \
--destination '{"Arn":"arn:aws:events:us-east-1:111122223333:event-bus/orders-bus"}' \
--event-start-time 2026-10-24T00:00:00Z --event-end-time 2026-10-25T00:00:00Z
- Archive: store events from a bus, optionally filtered by pattern, with a retention period.
- Replay: re-send archived events to a bus within a time window to reprocess after a bug fix or to seed a new consumer. SNS has no equivalent; once delivered, messages are gone.
- Schema registry and discovery: infer schemas from events and generate code bindings, helping teams agree on contracts.
- Careful with replay: consumers must be idempotent, and replays go back through the rules so side effects can repeat.
- Cost angle: archives and replays are billed separately from event ingestion, so set a retention period deliberately.
When to use which
Choose based on routing needs, scale and endpoints.
- EventBridge: reacting to AWS service events, content-based routing, SaaS integrations, cross-account event sharing, schedules, and architectures where you want replay and discoverable schemas.
- SNS: very high fan-out volume with low latency, direct delivery to SMS, email and mobile push, and the classic SNS-to-SQS fan-out pattern with FIFO ordering where needed.
- Quotas and latency: they differ in throughput limits, targets per rule and delivery latency; check current quotas rather than assuming, and load test if volume is high.
- Together: a common design is EventBridge for routing and SNS or SQS as targets for downstream fan-out.
- Ordering and dedupe: EventBridge does not offer FIFO ordering semantics; if you need strict order per key, route to an SQS FIFO queue or use SNS FIFO.
Production practice
Operate the bus like an API.
- Contracts: version
detail-typeor add a version field, and avoid breaking changes todetailshape. - Failure handling: configure retry policy and target DLQs, and alarm on
FailedInvocationsand DLQ depth. - Least privilege: restrict who can
PutEventsto a bus with resource policies, especially for cross-account access. - Observability: use CloudWatch metrics per rule and consider X-Ray or correlation IDs in the event detail.
- IaC: define buses, rules and targets in Terraform or CloudFormation so patterns are reviewed in pull requests.
- Cross-account pattern: a central bus in a platform account with rules forwarding to team buses keeps ownership clear.
- EventBridge is a serverless event bus with content-based rules, schemas, archive and replay; SNS is a fast pub/sub topic for simple fan-out and notifications.
- I validate patterns with test-event-pattern, send a put-events test and check target metrics and DLQs.
- I define buses and rules in IaC, version event contracts, and use replay for recovery with idempotent consumers.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Treating EventBridge as a drop-in SNS replacement for high-volume fan-out Quotas, latency and delivery endpoints differ; SNS is better for simple massive fan-out and SMS or email.
- Skipping target DLQs and retry policies Events that exhaust retries are dropped without a trace.
- Replaying archived events into non-idempotent consumers Replays re-trigger side effects such as emails or charges.
- Writing patterns without testing them A subtle mismatch means events silently match nothing; use test-event-pattern.