Amazon Simple Notification Service (SNS) is a highly available, durable, secure, fully managed pub/sub messaging service that enables you to decouple microservices, distributed systems, and serverless applications. Amazon SNS provides topics for high-throughput, push-based and many-to-many messaging.
Amazon SNS works on the concept of Publish-Subscribe model. Basically, there are two types of users in Amazon SNS – the publishers and the subscribers or producers and consumers. Publishers publish information on SNS, and Subscribers subscribe to receive information on topics of interest to them. Publishers or owners can create topics to which the consumers can subscribe. The publishers can grant or delete permissions, make modifications, set attributes for a topic, or delete a topic. They can also view a list of topics or the subscriptions for a topic. Subscribers can subscribe to a topic and view a list of subscriptions made by them.
Amazon SNS supports multiple protocols for publishing or receiving data. Information/data can be sent from or received on mobile devices using email, web service, SMS or Amazon SQS. Some of the supported services are:
- Amazon Device Messaging (ADM)
- Google Cloud Messaging for Android (GCM)
- Windows Push Notification Services (WNS)
- Apple Push Notification Service (APNS)
- Baidu Cloud Push (Baidu)
- Microsoft Push Notification Service for Windows Phone (MPNS)
- Event Sources and Destinations: Event-driven computing is a model in which subscriber services automatically perform work in response to events triggered by publisher services. Amazon SNS is an event-driven computing hub that has native integration with a wide variety of AWS event sources (including Amazon EC2, Amazon S3, and Amazon RDS) and AWS event destinations (including Amazon SQS, and Lambda). ‘
- Message Filtering: Message filtering empowers the subscriber to create a filter policy, so that it only gets the notifications it is interested in, as opposed to receiving every single message posted to the topic.
- Message Fanout: Message fanout occurs when a message is sent to a topic and then replicated and pushed to multiple endpoints. Fanout provides asynchronous event notifications, which in turn allows for parallel processing.
- Message Encryption: Amazon SNS provides encrypted topics to protect your messages from unauthorized and anonymous access. When you publish messages to encrypted topics, Amazon SNS immediately encrypts your messages. The encryption takes place on the server, using a 256-bit AES-GCM algorithm and a customer master key (CMK) issued with AWS Key Management Service(KMS).
- Mobile Notifications: Amazon SNS mobile notifications make it simple and cost effective to fanout mobile push notifications to iOS, Android, Fire OS, Windows and Baidu-based devices.
The most secure and best way to ensure all data is processed and stored is to redirect all device topics data to Amazon SNS which is designed to handle data flood processing, ensuring that incoming-data is reliably maintained, processed and delivered to the proper channel. To make it more scalable, multiple SNS topics, SQS queue, Lambda for a different/group of AWS device topics can be used. One should consider storing the data in safe-storage like a Queue, Amazon Kinesis, Amazon S3, and Amazon Redshift before processing. This practice ensures no data loss due to message floods, un-wanted exception code or deployment issues.