AWS-SNS is a notification service provided by Amazon. It provides cost-effective infrastructure for delivering bulk messages, particularly for mobile users. It is a simple, distributed publish-subscribe system. It is a cloud-based web service that uses the pub/sub messaging model to send single or bulk messages to multiple recipients. It lets you to send push notifications to email recipients, mobile device users, and even messages to other distributed services at the same time.
From the sender’s perspective, the SNS acts as a single message bus, capable of sending messages to a variety of devices and platforms, from Kindle Fire to Baidu. A single code interface can handle all these elements equally, or message formats can be tailored to the specific needs of each platform.
SNS can also send SMS messages to over 200 countries.
SNS uses the publish/subscribe model for push messages. Recipients subscribe to one or more “topics” on the SNS. This is usually hidden from the user as an internal part of a mobile app.
Receiving a message can also be hidden from the user: this service is primarily intended for the internal processing of certain applications and is not a general replacement for email. A game can receive bonus level advertisements or unlock keys for in-game purchases through this channel. A ticket booking app can use them for confirmation vouchers, boarding passes, or notifications of flight delays.
There are two types of clients on the SNS: publishers and subscribers (also known as producers and consumers, respectively). Publishers generate and send nonsynchronous messages to subscribers though a logical access point and communication channel (SNS topic). On the receiving side, subscribers (which include Amazon SQS queues, email addresses, web servers, or AWS Lambda functions) receive the published message or notification from the SNS service through supported protocols such as Amazon SQS, HTTP / S, email, SMS, and Lambda.
How does the SNS work?
Amazon SNS lets developers to synchronize, manage and send notifications from the cloud throughout several different channels to subscribe to endpoints/clients. To send messages through Amazon SNS, a component called Publisher simply sends a message to the subject. Threads load messages and send them instantly to all components that subscribe to the thread. Amazon SNS allows applications to transmit messages with very little or no queues, unlike Amazon SQS, which requires periodic “checking” or “polling” before messages are sent to recipients.
Amazon SNS consists of the following components/entities:
SNS Topics: logical access points that act as communication channels for pub/sub-messages. Each topic has a unique URI that identifies a specific topic, content, or event type. A theme allows developers to group multiple SNS endpoints (such as Amazon SQS, HTTP, HTTPS, AWS Lambda, email address, etc.) and filter messages sent to different subscribers. To deliver a message through Amazon SNS, publishers must first create a subject for the message.
SNS owners/administrators: Create topics and get full access to the SNS topic. Owners set permissions for all AWS accounts they create and own.
Publishers: Clients that compose and send asynchronous messages to an SNS topic. They communicate asynchronously with participants, generating and sending messages through a logical access point.
Subscribers: customers who wish to consume or receive messages or notifications on specific topics of interest.
How does AWS SNS come about?
Amazon Web Service Simple Notification Service (SNS) was originally released by Amazon in April 2010. The intention behind this simple messaging system was to empower app owners to send app push notifications to multiple platforms such as Fire OS, Apple, iOS, Windows, and even users on the go via a single API, via Baidu Cloud Push (regardless of the app store you are using). Today, Amazon SNS is used by Hike Messenger, Yelp, Yik Yak, WunderList, and others.
AWS SNS Technical Overview
Amazon SNS offers many resources for developers. There are three primary APIs in AWS SNS: CreateTopic, Subscribe and Publish. There are additional APIs for experienced developers. Simple and additional APIs allow editors to send a single message one or more times to multiple mobile devices.
There’s a mobile push notification feature that allows developers to send notifications to multiple app devices, such as Apple, Google, and Kindle Fire devices, and even multiple endpoints, including email, SMS, HTTP/S, and Amazon SQS-Endpoint.
Amazon SNS uses a 256-bit AES-GCM algorithm and a client master key (CMK) issued by the AWS Key Management Service (KMS) to store messages on the server. Messages are decrypted when delivered to signed endpoints or clients via supported protocols such as AWS SQS queues, HTTP / HTTPS webhooks, AWS Lambda functions, and more. To master AWS, visit AWS Training in Kolkata.
There are also VPC Endpoints (VPCEs) that allow developers to post private messages on SNS topics using an Amazon Virtual Private Cloud (VPC).
AWS SNS Benefits:
- Fully managed pub/sub messaging service
- Message sending model (without polling)
- Simple message architecture
- Supports multiple routes for notifications such as email, HTTP, and Lambda
- Integration with other AWS solutions
- AWS web-based admin console
- Robust security features
Disadvantages of AWS SNS:
- Insufficient debugging options
- Difficult to format email