サービス · 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.
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
| Compare | SNS | SQS | EventBridge |
|---|---|---|---|
| Model | Push | Pull | Push, by rule |
| Keeps messages | No | Yes, up to 14 days | No, but archive and replay |
| Consumers | Many subscribers | One group of consumers | Up to 5 targets per rule |
| Best for | Fan-out, SMS, email | Buffer and decouple | Event routing, SaaS, schedules |
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
| Compare | SNS | SQS | EventBridge |
|---|---|---|---|
| Model | Push | Pull | Push, by rule |
| Keeps messages | No | Yes, up to 14 days | No, but archive and replay |
| Consumers | Many subscribers | One group of consumers | Up to 5 targets per rule |
2 / 2
Best for
- SNS
- Fan-out, SMS, email
- SQS
- Buffer and decouple
- EventBridge
- Event routing, SaaS, schedules
| Compare | SNS | SQS | EventBridge |
|---|---|---|---|
| Best for | Fan-out, SMS, email | Buffer and decouple | Event routing, SaaS, schedules |
概要
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.
混同しやすいもの
Amazon Simple Queue Service (Amazon SQS)The settings that decide behavior: visibility timeout, long polling, delay, retention, DLQs, and scaling on queue depth.
Amazon EventBridgeEvent buses, rules, Pipes, Scheduler, archive and replay, and events across accounts and Regions.
Amazon KinesisReal-time streams that you size in shards. Partition keys decide order and balance.
ほかのタスクにも登場
このタスクの内容 · 2.1
- Microservices and stateless design
- Multi-tier architectures
- Event-driven and loose coupling patterns
- Serverless application patterns
- AWS Amplify and AWS Device Farm
- Horizontal vs vertical scaling
- Caching strategies
Load Balancing
API Gateway
- When and how to containerize
SQS
SNS
EventBridge
Step Functions
MQ
Secrets Manager
- Choosing purpose-built services
- Choosing object, file or block
Lambda
- Read replicas
ElastiCache
CloudFront
Global Accelerator
Transfer Family
S3
EFS
EBS
Fargate
ECS
EKS