AWS — Difference between Amazon EventBridge and Amazon SNS

Ashish Patel
Awesome Cloud
Published in
5 min readMar 29, 2022

Comparisons: AWS EventBridge vs AWS SNS.

Awesome Cloud: Amazon EventBridge and Amazon SNS

TL;DR:

Amazon EventBridge and Amazon SNS have many similarities, both can be used to decouple publishers and subscribers. However, there are differences in the list of targets and features for each service, and your choice of service depends on the needs of your use-case.

EventBridge provides more features.

Amazon EventBridge

Awesome Cloud: Amazon EventBridge

Amazon EventBridge is a serverless, fully managed, and scalable event bus that enables integrations between AWS services, Software as a services (SaaS), and your applications.

EventBridge delivers a stream of real-time data from AWS services, SaaS applications and your own applications to different types of targets without writing code. The publisher sends a JSON event to an event bus, and to receive events, you create a rule. If the published event matches with a rule, the event is routed to up to five targets. EventBridge is directly integrated with over 130 event sources and over 35 targets.

EventBridge Features

  • Advanced event rules filtering.
  • Content-based event filtering.
  • Schema registry.
  • Message transformation before sending to target.
  • Custom events.
  • Archive and replay events.
  • SaaS apps integration.
  • API destinations.

Amazon EventBridge builds upon and extends CloudWatch Events.

Amazon SNS

Awesome Cloud: Amazon SNS

Amazon SNS is a fully managed service that provides message delivery from publishers (producers) to subscribers (consumers). Publishers communicate asynchronously with subscribers by sending messages to a topic, which is a logical access point. Clients can subscribe to the SNS topic and receive published messages using a supported endpoint type.

SNS is used for both application-to-application (A2A) and application-to-person (A2P) communication. The A2A pub/sub functionality provides topics for high-throughput, push-based, many-to-many messaging between distributed systems, microservices, and event-driven serverless applications. Using Amazon SNS topics, your publisher systems can fan-out messages to a large number of subscriber systems.

SNS Features

  • Nearly unlimited throughput.
  • Very low latency (typical under 30 msec).
  • Many subscribers, high message fanout (SNS Standard support 100,000 Standard topics and each topic supports up to 12.5M subscriptions).

Key Differences: AWS EventBridge vs AWS SNS

Targets
EB: Lambda, SQS, SNS, Kinesis Streams, Kinesis Firehose (over 15 AWS services available as event targets).
SNS: Lambda, SQS, Kinesis Firehose, HTTP/S endpoints, Email, SMS, Mobile Push. (Only possible subscriber type for a FIFO topic is an SQS FIFO queue)

EventBridge has a lot more targets options.

Number of targets/subscriptions
EB: 300 rules per event bus and 5 targets per rule.
SNS: 2,500,000 subscriptions per Standard topic and 100 per subscriptions FIFO topic.

Message filtering
EB: Message Content-based filtering.
SNS: Message Attribute-based filtering and Content/Payload-based filtering (new).

Recently AWS introduced the payload-based message filtering option of SNS. Read more about it in blog and payload-based filtering.

Message transformation
EB: Supported. (In specific use cases, you might want to customize the text of event fields before passing them to a target)
SNS: Not supported.

FIFO Ordering
EB: Not supported.
SNS: Supported (with SNS FIFO Topics).

Delivery guarantee
EB: At least once.
SNS: At least once with SNS Standard. Exactly-once with SNS FIFO.

Schema Registry integration
EB: Supported.
SNS: Not supported.

A schema defines the structure of events that are sent to EventBridge. EventBridge provides schemas for all events that are generated by AWS services. You can also create or upload custom schemas or infer schemas directly from events on an event bus.

SaaS integration
EB: Supported.
SNS: Not supported.

EventBridge is the only event-based service that integrates directly with third-party SaaS partners.

Message replay
EB: Supported, Archive (for Infinite period) and Replay events.
SNS: Supported in FIFO only — new feature, Archive (for 365 days) and Replay events.

Cross-region
EB: Route events from any commercial AWS Region to other supported Regions (US East (N. Virginia), US West (Oregon), and Europe (Ireland).
SNS:
Supports cross-region delivery of notifications to SQS queues and to Lambda functions.

Publish throughput
EB: Varies by Region and adjustable quota.
SNS: Varies by Region and adjustable quota.

Dead-letter queues
EB: Supported.
SNS: Supported.

Max message size
EB: 256 KB.
SNS: 256 KB.

Encryption at rest and transit
EB: Supported (Not supported with KMS yet).
SNS: Supported.

Availability SLA
EB: 99.99%.
SNS: 99.9%.

Use Cases

Choose EventBridge if:

  • You want to build an application that reacts to events from SaaS applications, AWS services or Custom applications.
  • You want to publish messages to multiple subscribers, and use the event data itself to match targets interested certain patterns (content-based filtering: by creating rules that are applied across the entire event body/message content).
  • You want input transformation support based on your need.
  • You want to set up scheduled events using the popular Unix cron syntax.
  • You want to use unique features like built-in schema discovery capabilities, archive and replay events, etc.
  • You want a lot more targets and integration with a wider variety of services as a target.

EventBridge is the only event-based service that integrates directly with third-party SaaS partners.

Choose SNS if:

  • You want to build an application that reacts to high throughput or low latency messages published by other applications or microservices.
  • You want to publish messages to multiple subscribers with a single action (very high fan-out, thousands or millions of endpoints).
  • You want strict message ordering (first-in-first-out) (with FIFO Topics).
  • You want to publish and consume batches of messages.
  • You want built-in delivery subscriptions for SMS, email, mobile push and HTTP endpoints (that EventBridge does not provide).

Alternatives

  • Amazon MQ (RabbitMQ and ActiveMQ) — Not recommended for new cloud native applications.

Summary

Amazon EventBridge and Amazon SNS, both can be used to develop event-driven applications, and your choice will depend on your specific needs. It is recommended using SNS for applications that react to high throughput or low latency messages. On the other hand, EventBridge has the potential to be a key ingredient in a modern, highly distributed microservices architecture, and SaaS/AWS Services integration. Now a days, EventBridge has become a popular alternative.

--

--

Ashish Patel
Awesome Cloud

Cloud Architect • 4x AWS Certified • 6x Azure Certified • 1x Kubernetes Certified • MCP • .NET • Terraform • DevOps • Blogger [https://bit.ly/iamashishpatel]