Introduction to Amazon Simple Notification Service (Amazon SNS)
- a web service for mobile and enterprise messaging to set up, operate, and send notifications.
- SNS follows the publish-subscribe (pub-sub) messaging paradigm
- notifications delivered to clients using a push mechanism
- no need to check periodically (or poll) for new information and updates.
- A Pub/Sub messaging and mobile notifications for
- Microservices
- distributed systems
- serverless applications
- It makes it simple and cost effective to send push notifications to iOS and Android based devices.
- It supports
- HTTP/HTTPS
- Email/Email-JSON
- SMS
- Amazon Simple Queue Service (SQS) queues,
- AWS Lambda functions.
- two clients types– Publishers and Subscribers (or producers and consumers).
- Publishers communicate to subscribers asynchronously by sending a message to a topic.
- topic is logical access communication channel having list of subscribers and methods to communicate to them.
- If a message is sent to a topic, it is automatically forwarded to each subscriber of that topic.
- Methods to deliver can be SQS, HTTP, HTTPS, email, SMS, and AWS Lambda
- Below process at a high level is shown
Common Scenarios for Amazon SNS
- SNS supports various needs like
- monitoring applications
- workflow systems
- time-sensitive information updates
- mobile applications
- any other application which generates or consumes notifications
Fanout Scenario
- SNS message is sent to a topic and then replicated and pushed to SQS queues, HTTP endpoints, or email addresses.
- Supports parallel synchronous processing
- Then SQS queues subscribed to that topic will receive identical notifications for the new order.
- An EC2 instance attached to a queue handle processing or fulfillment of the order,
- EC2 instance attached to a parallel queue sends order data to a data warehouse application/service for analysis.
Application and System Alerts Scenario
- refer to SMS or email notifications triggered by predefined thresholds
- Like notification when specific change to Auto Scaling group in AWS.
Push Email and Text Messaging Scenario
- Push email and text messaging transmit messages to individuals or groups through email and/or SMS.
- Example – push targeted news headlines to subscribers by email or SMS.
Mobile Push Notifications Scenario
- send messages directly to mobile applications.
- Example notifications if an update is available.
Are you an AWS Expert?Take a Quiz