AWS SNS Summary

Amazon Simple Notification Service (SNS) is a fully managed service that provides message delivery from publishers to subscribers (also known as producers and consumers). It enables you to build distributed applications and microservices by facilitating message delivery (both push and fan-out) to a variety of endpoints or clients. Publishers communicate asynchronously with subscribers by sending messages to a topic, which is a logical access point and communication channel. Clients can subscribe to the SNS topic and receive published messages using a supported endpoint type, such as Amazon Data Firehose, Amazon SQS, AWS Lambda, HTTP, email, mobile push notifications, and mobile text messages (SMS).

How it Works

The publisher sends notifications to subscribers through an SNS topic, which filters messages that need to be distributed to different subscribers. Subscribers provide information such as a URL, email address, or phone number to receive messages. The sources list some of the common forms of SNS messages, including:

  • Application and system alerts, such as automatic user alerts triggered by predefined thresholds.
  • Push email or text messages.
  • Mobile push notifications.

Key Concepts

  • Topics: A central component in SNS that acts as a logical access point for subscribers. Messages sent to a topic can be received by multiple subscribers.
  • Subscriptions: Endpoints or clients that receive messages from topics. They include HTTP/S, Email, SMS, SQS, Lambda, and more.
  • Messages: The payload of information sent through SNS, which supports up to 256 KB of text data. Messages can include attributes for fine-grained control over message delivery.
  • Publishers: Applications or services that send messages to SNS topics. They use AWS SDKs (Software Development Kit) or APIs.

Benefits

  • Instant delivery: Works on a push-based system.
  • Cost-effective: Built on a pay-as-you-go basis.
  • Supports multiple endpoints: Different endpoints can receive messages via various transport protocols, including email, SMS, Lambda, Amazon SQS, HTTP, and more.
  • Ease of use: The AWS web management console offers a point-and-click interface.

Use Cases

  • Notification services: Sending push notifications, SMS, email, and other types of messages to subscribers.
  • Event-driven architectures: Triggering actions in response to events.
  • Decoupling microservices: Allowing microservices to communicate asynchronously.
  • IoT and mobile applications: Delivering notifications and alerts from IoT devices or mobile apps.
  • Fanout messaging: Enabling the fanout of messages to multiple subscribers.
  • Workflow orchestration: Coordinating workflows across distributed components.
  • Geo-redundant notifications: Delivering notifications in a geo-redundant manner.

Features

  • Flexible Message Delivery: Delivers messages via push notifications to mobile devices, HTTP endpoints, or email.
  • Reliability: Ensures message delivery with retries and supports message deduplication to avoid sending the same message multiple times.
  • Scalability: Designed to handle high-throughput and high-volume use cases.
  • Filtering: Supports message filtering based on message attributes.
  • Security and Access Control: Integrates with AWS Identity and Access Management (IAM).
  • Monitoring and Metrics: Provides detailed metrics and CloudWatch alarms.
  • Mobile Push Notifications: Integrates with mobile push notification services.