AWS provides multiple messaging and event-driven services: Amazon Simple Notification Service (SNS), Amazon Simple Queue Service (SQS), and Amazon EventBridge. Each serves different purposes in distributed architectures.
SNS is a pub-sub (publish-subscribe) service that enables real-time messaging. It pushes messages to multiple subscribers, including SQS queues, Lambda functions, email, SMS, or HTTP endpoints.
✔ Real-time push notifications – Messages are immediately delivered to subscribers.
✔ Multiple subscribers – One message can be sent to multiple destinations (fan-out architecture).
✔ Highly scalable – Can handle millions of messages per second.
✔ Flexible delivery options – Supports email, SMS, HTTP, Lambda, and SQS.
⛔ No message persistence – If a subscriber is unavailable, messages are lost (unless sent to SQS).
⛔ No ordering guarantee – Messages may be delivered out of order.
⛔ No automatic retries – If a subscriber fails, SNS does not retry automatically.
✅ You need real-time, push-based notifications to multiple subscribers.
✅ You have a fan-out pattern (one message sent to multiple consumers).
✅ You need low-latency event delivery (e.g., mobile push notifications, alerts).
SQS is a message queue service that allows messages to be stored and processed asynchronously. Unlike SNS, SQS pulls messages instead of pushing them.
✔ Message persistence – Messages are stored until processed or expired.
✔ Decoupling of services – Allows microservices to process tasks asynchronously.
✔ Scalability – Automatically scales based on workload.
✔ Message durability – Stores messages across multiple availability zones.
✔ Supports FIFO (First-In-First-Out) – Ensures ordered and exactly-once message delivery when needed.
⛔ Polling required – Consumers must pull messages instead of receiving them in real-time.
⛔ Limited message retention – Messages are stored for a maximum of 14 days.
⛔ No direct fan-out – To send messages to multiple consumers, SNS needs to fan out to multiple SQS queues.
✅ You need asynchronous processing and message persistence.
✅ You want to decouple services (e.g., order processing, background jobs).
✅ You need FIFO ordering and exactly-once processing (with FIFO SQS).
✅ You have high-volume message processing requirements.
EventBridge is a serverless event bus that allows applications to react to AWS events or custom application events. It routes events based on rules to different targets.
✔ Event-driven architecture – Enables loosely coupled microservices.
✔ Schema registry – Helps applications understand event formats.
✔ No need for polling – Events are pushed to targets automatically.
✔ Tightly integrated with AWS services – Works with Lambda, Step Functions, SQS, and third-party SaaS applications.
✔ Supports cross-account and cross-region events – Facilitates multi-account AWS environments.
⛔ Higher latency than SNS – Not ideal for ultra-low-latency needs.
⛔ No message persistence – If a target fails, the event may be lost unless configured with a dead-letter queue (DLQ).
⛔ Limited delivery retry logic – Retries are limited compared to SQS.
✅ You need event-driven architectures with multiple AWS service integrations.
✅ You need cross-account or SaaS event processing.
✅ You want routing flexibility based on event content.
✅ You are building serverless applications with Lambda, Step Functions, or SQS.
Which One to Choose?
Use SNS when you need real-time push-based notifications to multiple subscribers.
Use SQS when you need asynchronous processing and message persistence for decoupling services.
Use EventBridge when you need event-driven architectures with flexible event routing.
💡 Best Practices:
For fan-out with message persistence: Use SNS + SQS (SNS delivers to multiple SQS queues).
For real-time event-driven applications: Use EventBridge for AWS-native integrations.
For reliable message delivery: Use SQS with a dead-letter queue (DLQ) to prevent message loss.
Posted by :
Risqi Ikhsani
February 6th, 2025
Reach Us
We'd love to assist you. Fill out the form or drop us an email.
Visit Us
Drop by our office for a chat.
Gedung Pondok Indah Office Tower 3, 17th Floor, Jl. Sultan Iskandar Muda Kav V-TA, Jakarta 12310, Indonesia