📖 What is SNS?
Simple Notification Service (SNS) is a fully managed pub/sub messaging service enabling decoupling of microservices, system notifications, and event-driven architectures. It supports message delivery via topics and subscriptions to various endpoints, including SQS, Lambda, and HTTP/S.
"Understand SNS’s role in event-driven systems. Exam questions frequently test the interaction between SNS and SQS for reliable message delivery. Distinguish between fanout to multiple SQS queues versus direct Lambda invocation."
📚 Certification: AWS Certified Solutions Architect - Associate (SAA-C03)
🔑 What are the Key Concepts of SNS?
- ▸ SNS topics act as access points for sending messages, and subscribers determine where those messages are delivered.
- ▸ Supported protocols include HTTP/S, email, SMS, SQS, and AWS Lambda, offering flexible integration options.
- ▸ Message filtering allows subscribers to only receive messages with specific attributes, reducing unnecessary processing.
- ▸ SNS supports publish/subscribe (pub/sub) messaging, enabling one-to-many communication for event distribution.
- ▸ SNS message delivery is best-effort, but integration with SQS provides reliable queuing for critical applications.
🎯 How does SNS appear on the SAA-C03 Exam?
You may be asked to identify the AWS service best suited for broadcasting a single event to multiple downstream systems, such as triggering Lambda functions and updating a mobile application.
A scenario might describe a system needing to send notifications to users via SMS and email based on specific events – determine how SNS can facilitate this.
Expect questions about configuring SNS topics and subscriptions, including understanding the impact of access policies and message filtering on message delivery.
❓ Frequently Asked Questions
When should I use SNS with SQS instead of directly invoking Lambda functions?
Using SQS as a subscriber provides buffering and retry mechanisms, ensuring message delivery even if Lambda experiences temporary issues. This enhances system reliability and prevents message loss.
How can I ensure only authorized subscribers receive messages from an SNS topic?
SNS access policies control who can publish and subscribe to topics. You can also use message filtering based on attributes to restrict message delivery to specific subscribers.
What are the limitations of SNS message size, and how can I work around them?
SNS has a message size limit of 256KB. For larger payloads, store the data in S3 and send the S3 object key as the SNS message, allowing subscribers to retrieve the full content.