Open In App

Simple Notification Service (SNS) in AWS

Last Updated : 08 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Amazon Web Services Simple Notification Service (AWS SNS) is a web service that automates the process of sending notifications to the subscribers attached to it. SNS provides this service to both application-to-person and application-to-application. It uses the publishers/subscribers paradigm for the push and delivery of messages. The data loss is prevented by storing the data across multiple availability zones. It is cost-efficient and provides low-cost infrastructure, especially for mobile users. It sends the notifications through SMS or email to an Amazon Simple Queue Service (SQS), AWS lambda functions, or an HTTP endpoint. When the CPU utilization of an instance goes above 80%, the AWS cloudwatch alarm is triggered. This cloudwatch alarm activates the SNS topic hence notifying the subscribers about the high CPU utilization of the instance. SNS service has a topic that has a unique name. It acts as a logical access point and a communication channel between publishers and subscribers.  

How Does (AWS) Amazon Simple Notification Service (SNS) Work?

Simple Notification Service (SNS) sends the notifications through SMS or email to an Amazon Simple Queue Service (SQS), AWS lambda functions, or an HTTP endpoint. When the CPU utilization of an instance goes above 80%, the AWS cloudwatch alarm is triggered. This cloudwatch alarm activates the SNS topic hence notifying the subscribers about the high CPU utilization of the instance. SNS service has a topic that has a unique name. It acts as a logical access point and a communication channel between publishers and subscribers.  

aws-sqs

Use cases Of (AWS) Amazon Simple Notification Services (SNS)

  • Decoupling microservices and distributed systems: SNS is mostly to decouple microservices and distributed systems by providing that will allow them to communicate with each other asynchronously. Helps in improving the scalability and reliability of the systems.
  • Sending notifications to users: SNS can be used to send notifications to users about events that occur in your applications. For example, you can use SNS to send users notifications when they receive a new message, when their account is updated, or when an event occurs that they have subscribed to.
  • Sending alerts to operators: SNS can be used to send alerts to operators about problems that occur in your applications. For example, you can use SNS to send operators alerts when a server goes down or when an error occurs.
  • Building serverless applications: SNS can be used to build serverless applications by providing a way for them to communicate with each other and to send and receive notifications.

 Benefits Of Using (AWS) Amazon Simple Notification Service (SNS) SNS   

  • SNS increases Durability. 
  • SNS increases Security.
  • SNS ensures accuracy.
  • SNS reduces and simplifies the cost.
  • SNS supports SMS in over 200 countries.

Features (AWS) Amazon Simple Notification Service (SNS)

  • Scalability: Simple Notification Service (SNS) had a capacity to handle millions of messages per second from thedifferent sources.
  • Security: Simple Notification Service (SNS) is very secured and it also offers wide range of security offers.
  • High Avalibility: Simple Notification Service (SNS) is designed to have more durability which ensures the message are delivered without any latency.
  • Flexibily To Use: SNS supports a variety of transport protocols and can be used to send notifications to a variety of applications.

Clients Of (AWS) Amazon Simple Notification Service (SNS)

  • Publishers: They communicate with subscribers asynchronously by producing and sending a message to a topic (i.e. a logical access point and communication channel). They do not include a specific destination (e.g. – email ID) in each message instead, send a message to the topic. They only send messages to topics they have permission to publish.
  • Subscribers: Subscribers like web servers, email addresses, Amazon SQS queues, and AWS Lambda functions receive the notification over one of the supported protocols like Amazon SQS, HTTP/S, email, SMS, Lambda) when they are subscribed to the topic. Amazon SNS matches the topic to a list of subscribers who have subscribed to that topic and delivers the message to each of those subscribers.

Steps to Create Amazon Simple Notification Service  in (AWS)

Step 1: Go to the Amazon SNS dashboard. Click on Create Topic button.

Create Topic

Step 2: Type in the name of the topic and description( optional )

Configure topic details

Step 3: Type in the key value of the tag which is completely optional. Click on create the topic.

Key-value pairs

Step 4: Congratulations!! The topic is created successfully.

Topic is created

Step 5: Go back to the SNS dashboard. The created topic is visible in the dashboard now. Click on the link to the topic. 

Topics

Step 6: You will be redirected to this page. Under subscription options, Click on Create subscription.

Create Subcription

Step 7: Select the Protocol of the topic as Email and the endpoint of the topic as your email id. Click on Create Subscription.

Configure  Subcription Details

Step 8: Now go to the mailbox of the mentioned email id and click on Confirm subscription.

Confirm The Subcription

Step 9: You will be directed to this page. Your subscription is confirmed.

Subcription Confirmed

Amazon SNS pricing

Amazon SNS pricing is dependent up on the type of tier your using as follows:

  • Publish and publish batch requests: $0.30 per 1 million requests and $0.017 per GB of payload data.
  • Subscription messages: $0.01 per 1 million messages and $0.001 per GB of payload data.
  • Topic owner and subscription owner requests: $0.50 per 1 million requests.

FAQs On AWS Simple Notification Service (SNS)

1. What Is The Mechanism Used By The Simple Notification Service SNS For Messaging?

Amazon Simple Notification Service (SNS) uses a publish-subscribe (pub/sub) messaging model. In this model, publishers send messages to topics, and subscribers receive messages from topics.

2. Is SNS A Message Broker?

Amazon Simple Notification Service (SNS) is a messaging service, but it is not a message broker. A message broker is a software application that acts as an intermediary between message producers and consumers.

3. AWS SNS Service

Amazon Simple Notification Service (Amazon SNS) is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication.

4. AWS SNS VS SQS

SNS: Amazon Simple Notification Service (SNS) and Amazon Simple Queue Service (SQS) are both fully managed messaging services offered by Amazon Web Services (AWS).

SQS: Amazon SQS is a message queueing service that allows you to store messages temporarily before they are processed.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads