ladderlore
ガイドをリクエスト
  • S3 や IAM などのサービス名を入力してください。

サービス · Application Integration · 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.

このレッスンはまだ翻訳されていないため、英語で表示しています。

クラウドプラクティショナーで学んだこと

  • 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.
クラウドプラクティショナーのレッスンを読む
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.

概要

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.

概要

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.

概要

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.

覚えること

  • 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.

覚えること

  • 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.

試験では

  • “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.