📖 What is Amazon SNS?
Amazon Simple Notification Service (SNS) is a fully managed pub/sub messaging service enabling application-to-application (A2A) and application-to-person (A2P) communication. It allows you to send notifications via various protocols, including email, SMS, and mobile push notifications, facilitating event-driven architectures.
"SNS is a push-based service; messages are pushed to subscribers. Common use cases include triggering notifications from CloudWatch alarms or integrating with SQS for decoupled workflows. Understand the difference between SNS (pub/sub) and SQS (message queue). Exam questions often present scenarios requiring notification services."
📚 Certification: AWS Certified Cloud Practitioner (CLF-C02)
🔑 What are the Key Concepts of Amazon SNS?
- ▸ SNS utilizes a publish/subscribe (pub/sub) model, allowing multiple subscribers to receive the same message from a single publisher.
- ▸ Topics in SNS act as logical access points and are used to categorize messages, enabling targeted notification delivery to specific subscribers.
- ▸ SNS supports multiple delivery protocols including email, SMS, HTTP/S, SQS, and mobile push notifications, offering flexible integration options.
- ▸ SNS can be integrated with AWS IAM to control access and permissions, ensuring secure message publishing and subscription management.
- ▸ Message filtering allows subscribers to only receive messages based on specific attributes, reducing unnecessary notifications and processing.
🎯 How does Amazon SNS appear on the CLF-C02 Exam?
You may be asked to identify the AWS service best suited for sending notifications to users when an EC2 instance state changes, triggered by a CloudWatch alarm.
A scenario might describe an application needing to decouple components; expect questions about using SNS to trigger Lambda functions or deliver messages to SQS queues.
Expect questions about choosing between SNS and SQS based on whether a message needs to be delivered to multiple consumers (SNS) or processed by a single worker (SQS).
❓ Frequently Asked Questions
When would I choose SNS over SQS?
Choose SNS when you need to broadcast a message to multiple subscribers simultaneously. SQS is better for decoupling and reliable queuing where each message is processed only once.
What are the limitations of SNS message size?
SNS messages have a maximum size of 256KB. If you need to send larger payloads, consider storing the data in S3 and sending an S3 object URL via SNS.
How can I ensure my SNS messages are delivered reliably?
SNS offers message retries and dead-letter queues (DLQs) to handle failed deliveries. Configure DLQs to capture undeliverable messages for further investigation and reprocessing.