Amazon Simple Notification Service
With a fully managed Pub/Sub service, Amazon Simple Notification Service offers both A2A and A2P communications.
Amazon Simple Notification Service Benefits
A2A (application-to-application) notifications
To integrate and decouple distributed apps, send application-to-application (A2A) alerts.
Notifications from applications to people (A2P)
Use push notifications, email, and SMS texts to provide application-to-person (A2P) alerts to your clients.
Simplify your architecture
Message filtering, batching, sorting, and deduplication can simplify your design and save expenses.
Boost the resilience of the message
Use dead-letter queues (DLQs), archiving, replay, and delivery retries to increase the durability of messages.
Amazon SNS Use Cases
Connect your apps to FIFO messaging
To ensure accuracy and consistency across separate applications, provide messages in a rigorously ordered, first in, first out (FIFO) fashion.
Encrypt the delivery of alert messages securely
Utilise AWS Key Management Service (KMS) to encrypt messages, AWS PrivateLink to protect traffic privacy, and resource policies and tags to manage access.
Record and distribute events from more than 60 AWS services
Events are spread out over AWS categories, including databases, analytics, computation, containers, IoT, machine learning (ML), security, and storage.
Send SMS messages to clients in more than 240 nations
Use global SMS with provider redundancy. Use a sender ID, long code, short code, TFN, or 10DLC to set the originating identification of the SMS.
Amazon SNS Features
Topic types
Standard topics
As long as your program can handle messages that arrive repeatedly and out of sequence, standard topics can be utilised in a variety of situations. Some examples include fanning out messages to apps for media encoding, fraud detection, tax computation, search indexing, and important alerting.
Maximum throughput: Almost an infinite number of messages can be sent per second using standard topics.
Best-effort ordering: Sometimes, messages may be sent out in a different order than when they were first published.
In best-effort deduplication, a message is sent at least once, but sometimes it is sent in many copies.
Several subscription options: Messages can be sent to application-to-person (A2P) endpoints (email, mobile push, and SMS) and application-to-application (A2A) endpoints (Amazon SQS, Amazon Kinesis Data Firehose, AWS Lambda, and HTTPS).
Message fanout: Up to 12.5M subscriptions can be made to each Standard subject, and each account can support 100,000 Standard topics.
FIFO Topics
When the order of events and operations is crucial or when duplicates cannot be allowed, FIFO topics are intended to improve messaging between applications. Examples of these include fanning out messages to applications for price updates, inventory management, flight tracking, stock monitoring, and bank transaction logging.
High throughput: FIFO topics can handle up to 10 MB per second per FIFO topic or 3,000 messages per second, whichever is faster.
Strict ordering: Messages are published and delivered in a rigorously maintained order, known as first-in-first-out.
Strict deduplication: No duplicate messages are sent. Deduplication occurs five minutes after the message is published.
Subscriptions to SQS: Amazon SQS queues can receive messages.
Fanout of messages: Each account can have up to 1,000 FIFO topics, and each subject can have up to 100 subscriptions.
Event sources and destinations
According to the event-driven computing paradigm, publisher services initiate events that cause subscriber services to automatically carry out tasks. Workflows can be automated with this paradigm, which also decouples the services that separately and collectively do these tasks. Many different AWS event sources and event destinations are natively integrated with Amazon SNS, an event-driven hub.
Message batching and publication
Through message publishing, you can send data in the form of messages to an Amazon SNS topic, which will then asynchronously distribute the messages to the applications that have subscribed to the topic. One to ten messages may be published per API request. To cut your Amazon SNS expenses, you might decide to send messages in bulk. A maximum of 256KB of data may be included in each message. In the event that your use case calls for larger data payloads, the Amazon SNS Extended Client Library can store the payload up to 2GB in an Amazon S3 bucket and publish the reference to the stored Amazon S3 object to the Amazon SNS topic.
Filtering message
The ability to define filter policies for your subscriber applications allows them to get only the alerts that they are interested in, rather than all of the messages broadcast to the subject. This allows you to simplify your design by removing the message routing functionality from publisher applications and the message filtering logic from subscriber applications.
Distribution and delivery of the message
Amazon SNS replicates topic messages to subscribed apps. Amazon SNS delivers A2P and A2A messages. Amazon CloudWatch logs message delivery status, and Amazon SNS delivers cross-region and cross-account messages.
Durability of the message
To ensure message longevity, Amazon SNS employs a variety of approaches. Firstly, published messages are spread among several geographically dispersed servers and data centres. Amazon SNS uses a message delivery retry policy in the event that a subscribed endpoint is unavailable. You can use a dead-letter queue powered by Amazon SQS to save any messages that aren’t delivered before the delivery retry policy expires. Messages can be transmitted to persistent endpoints like Amazon S3 buckets or Amazon Redshift tables by subscribing Amazon Kinesis Data Firehose delivery streams to Amazon SNS topics.
Encrypting the message
To shield your messages from anonymous and unauthorised access, Amazon SNS offers encrypted topics. Amazon SNS instantly encrypts messages when you submit them to encrypted topics. Using a 256-bit AES-GCM algorithm and a Customer Master Key (CMK) provided by AWS Key Management Service (KMS), the encryption is performed on the server. Phone numbers, email addresses, mobile apps, Amazon SQS queues, Amazon Kinesis Data Firehose streams, AWS Lambda functions, HTTP/S endpoints, and other subscribing endpoints get the encrypted messages, which are then decrypted during delivery.
Privacy of messages
Through AWS PrivateLink, Amazon SNS facilitates VPC Endpoints (VPCE). By using VPC Endpoints, you can publish private messages to Amazon SNS topics from an Amazon Virtual Private Cloud (VPC) without using the public internet. In addition to providing extra protection, this feature supports data privacy initiatives and is consistent with assurance processes. AWS PrivateLink eliminates the requirement to configure a Virtual Private Network (VPN), Internet Gateway (IGW), or Network Address Translation (NAT) device. Public IP addresses are also not required.
Message data security
Topic owners are empowered to create data protection policies that can identify and safeguard sensitive information sent over their topics thanks to Amazon SNS message data protection. By removing data protection logic from your apps, you can streamline your architecture and support your compliance goals, such as those outlined in the Federal Risk and Authorisation Management Program (FedRAMP), the General Data Privacy Regulation (GDPR), the Health Insurance Portability and Accountability Act (HIPAA), and the Payment Card Industry Compliance (PCI). You can prohibit messages from reaching downstream subscribers, redact or mask certain data in the payload, or audit incoming messages to a topic to find out how much sensitive data they include.
Analytics, replaying, and preservation of messages
Amazon SNS offers a direct link to Amazon Kinesis Data Firehose for Standard topics, enabling message storage in services like MongoDB, Amazon S3, Amazon Redshift, and Amazon OpenSearch Service. Additionally, this capability allows message preservation in analytics programs like Splunk, Datadog, and New Relic. Without requiring the establishment of an independent archival repository, Amazon SNS provides an in-place solution for storing and replaying your messages for FIFO topics. This can help you recover from downstream failure scenarios and increases the robustness of your event-driven applications.
SMS Text Messages
Using a highly accessible and robust service with redundancy across various SMS providers, Amazon SNS enables the sending of SMS text messages at scale to more than 200 countries. By employing a sender ID, long codes, or short codes, you can manage your originating identification using Amazon SNS. Additionally, before putting your SMS workloads into production, you can test them out in the Amazon SNS sandbox.
Push alerts for mobile devices
Distributing mobile push alerts to iOS, Android, Fire, Windows, and Baidu devices is easy and affordable using Amazon SNS mobile notifications. Both business logic and user-driven actions can initiate mobile notifications. Firebase Cloud Messaging (FCM), Microsoft Push Notification Service for Windows Phone (MPNS), Baidu Cloud Push (Baidu), Apple Push Notification Service (APNs), Amazon Device Messaging (ADM), and Windows Push Notification Services (WNS) are the ways that Amazon SNS provides push notifications for mobile devices.
Notifications of emails
Email addresses that have subscribed to topics can receive notifications from Amazon SNS. Many use cases are supported by this feature. To increase visibility into your DevOps workflows, for instance, you can utilise Amazon SNS to receive application warnings as email notifications. This allows you to receive instant notifications whenever something happens, such a change to your Amazon EC2 Auto Scaling group, a new file uploaded to your Amazon S3 bucket, or a break in a metric threshold in Amazon CloudWatch.
Amazon SNS cost
Long-term contracts, minimum commitments, and upfront costs are all avoided using Amazon Simple Notification Service (SNS). You just pay for the content you utilise, according to the topic you use. Standard topics or FIFO topics are the definition of SNS topics. Your consumption will be billed at the end of each month. For more details on the pricing of each topic Amazon SNS click here.