ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Service · Application Integration · Builds on CLF-C02

Amazon Simple Notification Service (Amazon SNS)

Filter policies, FIFO topics, fan-out to SQS, retries and DLQs, and when to pick SNS, SQS or EventBridge.

You know from Cloud Practitioner

  • SNS is publish and subscribe: one message to a topic, pushed to every subscriber.
  • Subscribers: SQS queues, Lambda, HTTPS endpoints, email, SMS and mobile push.
  • SNS does not hold messages for later. Put SQS behind it when none may be lost.
Read the Cloud Practitioner lesson
Order service
SNS
SQSLambda
Email and SMS
paid only
One publish reaches a queue, a function and people. A filter policy trims each branch.
  • Model

    SNS
    Push
    SQS
    Pull
    EventBridge
    Push, by rule
  • Keeps messages

    SNS
    No
    SQS
    Yes, up to 14 days
    EventBridge
    No, but archive and replay
  • Consumers

    SNS
    Many subscribers
    SQS
    One group of consumers
    EventBridge
    Up to 5 targets per rule
  • Best for

    SNS
    Fan-out, SMS, email
    SQS
    Buffer and decouple
    EventBridge
    Event routing, SaaS, schedules
Three services, three jobs.

1 / 2

  • Model

    SNS
    Push
    SQS
    Pull
    EventBridge
    Push, by rule
  • Keeps messages

    SNS
    No
    SQS
    Yes, up to 14 days
    EventBridge
    No, but archive and replay
  • Consumers

    SNS
    Many subscribers
    SQS
    One group of consumers
    EventBridge
    Up to 5 targets per rule

2 / 2

  • Best for

    SNS
    Fan-out, SMS, email
    SQS
    Buffer and decouple
    EventBridge
    Event routing, SaaS, schedules
Three services, three jobs.

What it is

A standard topic gives very high throughput, best-effort order and at-least-once delivery. A FIFO topic keeps order within a message group and removes duplicates. Use SQS FIFO queues as its subscribers to keep the order end to end. A subscription filter policy lets each subscriber receive only the messages whose attributes match, so one topic can serve many purposes with no filtering code in the consumers.

What it is

The fan-out pattern puts an SQS queue behind each subscriber. The queue holds the message if the consumer is slow or down, and each consumer has its own retries and DLQ. SNS also retries failed deliveries. For Lambda and SQS endpoints it retries for over 23 days. For email, SMS and mobile push it tries about 50 times over 6 hours. Attach a dead-letter queue to a subscription to keep messages that still fail.

What it is

Choose by need. SNS pushes one message to many subscribers at once. SQS stores messages for one group of consumers who pull. EventBridge routes events by content, with schedules, many AWS and SaaS sources, and archive and replay. SNS is the simple way to send SMS, email and mobile push to many people from one topic. For bulk or marketing email, Amazon SES is the email service.

Remember

  • Standard topic: high throughput, at-least-once. FIFO topic: order and deduplication.
  • Filter policy: each subscriber gets only the matching messages.
  • Fan-out: a topic with one SQS queue per consumer.
  • Retries: over 23 days for Lambda and SQS, about 6 hours for email, SMS and push.
  • Attach a DLQ to a subscription to keep undeliverable messages.

Remember

  • SNS is the simple way to send SMS, email and mobile push to many people from one topic. For bulk or marketing email, Amazon SES is the email service.

On the exam

  • “Each order must reach billing, shipping and analytics independently” points to SNS fan-out to SQS queues.
  • “Send only high-priority messages to this subscriber” points to a subscription filter policy.
  • “Text message to customers” points to Amazon SNS.
  • “Route events by content from many AWS services, with replay” points to EventBridge, not SNS.