Amazon Simple Notification Service (SNS) is a managed service that delivers messages from publishers to subscribers (also known as producers and consumers). Publishers communicate asynchronously by sending messages on a topic that serves as a logical access point and communication route for subscribers. Clients can subscribe to an SNS topic and receive published messages via any supported endpoint, including Amazon Kinesis Data Firehose, Amazon SQS, AWS Lambda, HTTP, email, mobile push notifications, and mobile text messaging (SMS).
What is Amazon SNS?
The Simple Notification Service (Amazon SNS) sends push notifications from the application to subscriber end users or other programs. It is a fully messaging service for communication between applications (A2A) and people (A2P). It allows you to create a topic as a logical access point and communication channel. Each subject has a unique name that specifies the SNS endpoint where publishers can send messages and subscribers can subscribe to notifications.
Features of the Amazon Simple Notification Service
These are some of the Features of SNS
Auto-scaling: As the volume of messages grows, it scales accordingly.
Message Encryption: Protects your messages using encrypted themes from unwanted and unknown access. When messages are transmitted to subscriber endpoints, they are decrypted.
Message filtering: This allows the subscriber to change the filtering policy so that he only receives relevant notifications.
When a message is sent to a topic, it is replicated and sent to multiple endpoints, called message branching. Asynchronous event notification is provided by Fanout, allowing for parallel processing.
Mobile Notification: User-initiated in-app actions or cloud-based business logic can be triggered. Distributing mobile push notifications for iOS, Android, Fire OS, Windows, and Baidu-based devices are cheap.
SNS and Email Messaging: Amazon SNS can send text and email messages (SMTP).
How does AWS SNS Work?
As mentioned earlier, AWS SNS sends messages to its endpoints using the Publisher-Subscriber paradigm. You can use Amazon SNS to filter messages for a larger number of subscribers or endpoints through mobile communications, SMS, and email.
Publishers, also known as producers, create and send messages to AWS SNS.
On the other hand, subscribers receive messages published by the SNS using supported network protocols such as Amazon SQS, AWS Lambda, or HTTP/HTTPS.
Below are the exact stages of the workflow that AWS SNS implements:
The publisher first sends the required notifications to the subscribers.
SNS Topic – Used to filter out messages that need to be distributed to different subscribers. As an AWS developer, you must create an SNS topic that will serve as a subscriber access point. Subscribers can receive news alerts on a selected topic using a topic.
The message is delivered to the subscriber via subscriber queues or microservices. To receive a message, subscribers must submit valuable information such as a URL, email address, or phone number. Below are some of the most common forms of SNS messages:
Automatic user alerts triggered by predefined thresholds and sent to specific users via SMS or email are known as application and system alerts.
Push email or text messages are two ways to communicate with people or groups (for example, news article alerts sent to newspaper subscribers).
Mobile push notifications are messages sent directly to mobile applications (for example, notification of any application update available for installation).
How does Amazon SNS Message Filtering Work?
How Amazon SNS uses message filtering to deliver only a subset of SNS topic messages to subscriber endpoints. For example, consider a company website that sends user queries to many backend servers.
Source:-https://docs.aws.amazon.com
This server network consists of:
First, 1 server to handle requests from “Type 1” users.
Second, 1 server to handle “type 2” user requests.
1 data analysis server handles both “Type 1” and “Type 2” user requests.
Following are the six stages of implementing message filtering with Amazon SNS:
Create an Amazon SNS topic
The first step is to set up an Amazon SNS topic to send messages whenever a user requests the site.
Use the “AWS Services” search box to find the Amazon SNS console.
Click “Get Started with an Overview” on the SNS Console landing page, then click “Topics” from the left-hand menu.
Then, in the dialog box, click “Create Topic” and enter the name of your topic (“Topic 1”) in the “Topic Name” field (shown below).
To create and add a new topic to the “Topic” detail page, click “Create Topic” in the dialog box above.
Create Amazon SQS Queues
The next step is creating Amazon SQS queues that subscribe to the SNS topic. Backend web servers query user requests from the corresponding SQS message queue. For this example:
Queue_1 processes requests from “type 1” users.
Queue_2 handles requests from “type 2” users.
Queue_3 handles both “Type 1” and “Type 2” user requests.
Sign in to the AWS SQS console using your username and password.
Then enter the Ques’ name as “Queue 1” in “Queue Name.” Click on “Quick-Create Queue” with “Standard Queue” selected.
Repeat step b to create two new queues named “Queue 2” and “Queue 3”. All three SQS queues are listed on the SQS console page once created.
Benefits of Amazon Simple Notification Service
The benefits of AWS SNS are as follows:
Instant delivery: Works on a push-based system. It is sent once a message is posted on a topic and forwarded to many subscribers.
It’s cheap because it’s built on a pay-as-you-go basis, which means we only pay when we use the resources and you don’t pay any upfront fees.
Multiple endpoints are supported, making it versatile. Different endpoints can receive messages via different transport protocols, including email, SMS, Lambda, Amazon SQS, HTTP, and more.
Ease of use: The AWS web management console offers the simplicity of a point-and-click interface, making it a very straightforward service.
Amazon SNS Pricing
Amazon SNS comes standard with a generous free tier and is reasonably priced. No subscription is required; you simply pay for the services you use on your chosen endpoint type. We will be sent 1 million free mobile push notifications every month. After that, each delivered message is charged $0.5 per million, depending on the recipient’s area.
What is Amazon SNS Security?
Let’s see the Security of AWS SNS
To protect messages from unwanted and unexplained access, SNS offers encrypted topics. Encryption takes place on the server.
Amazon SNS supports VPC endpoints through AWS Private Link. We can use VPC endpoints to send messages to SNS topics from the VPC without going over the public Internet.
Use access policies to limit which endpoints a topic allows, who has permission to publish the topic, and under what conditions.
You can enable AWS X-Ray for messages traveling through Amazon SNS, making it much easier to track and analyze messages traveling to downstream services.
Advantages of SNS
Instant delivery: Push-based delivery is the foundation of SNS. This is the most significant difference between SNS and SQS. When you post a message on a topic distributed to several subscribers, SNS is a push.
Flexible: Flexible SNS supports multiple types of endpoints. Different endpoints can receive messages via different transport protocols, including email, SMS, Lambda, Amazon SQS, HTTP, and more.
Inexpensive: The SNS service is low cost because it is built on a pay-as-you-go basis, meaning you only pay when you use the resources, and there are no upfront costs.
User-friendliness.
Ease of use: SNS is straightforward with a point-and-click web-based AWS management console interface.
Simple architecture: SNS is used to simplify the messaging architecture by offloading message filtering and routing complexity from subscribers and publishers.
Conclusion
Amazon SNS is intended to be used with other Amazon Web Services, such as Amazon SQS and EC2. For example, applications running on Amazon EC2 can publish event/information changes to Amazon SNS and immediately distribute them to all other end users. In addition, the subscriber can choose Amazon SQS as the delivery mechanism that sends notifications to different SQS queues in parallel, providing message persistence and formal assurance that messages are delivered. If you use Amazon SNS, you should enable it on your mobile devices to use its features.
Features of AWS SNS include:- Auto-Scaling, Message Filtering, Mobile Notification, SMS, and Email messaging.
It allows you to create a topic as a logical access point and communication channel. Each subject has a unique name that specifies the SNS endpoint where publishers can send messages and subscribers can subscribe to notifications.
To protect messages from unwanted and unexplained access, SNS offers encrypted topics. Encryption takes place on the server. Amazon SNS supports VPC endpoints through AWS PrivateLink. We can use VPC endpoints to send messages to SNS topics from the VPC without going over the public Internet.
The SNS service is low cost because it is built on a pay-as-you-go basis, meaning you only pay when you use the resources, and there are no upfront costs.
The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.
Data Analyst who love to drive insights by visualizing the data and extracting the knowledge from it. Automating various tasks using python & builds Real time Dashboard's using tech like React and node.js. Capable of Creaking complex SQL queries to fetch the accurate data.
We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.
Show details
Powered By
Cookies
This site uses cookies to ensure that you get the best experience possible. To learn more about how we use cookies, please refer to our Privacy Policy & Cookies Policy.
brahmaid
It is needed for personalizing the website.
csrftoken
This cookie is used to prevent Cross-site request forgery (often abbreviated as CSRF) attacks of the website
Identityid
Preserves the login/logout state of users across the whole site.
sessionid
Preserves users' states across page requests.
g_state
Google One-Tap login adds this g_state cookie to set the user status on how they interact with the One-Tap modal.
MUID
Used by Microsoft Clarity, to store and track visits across websites.
_clck
Used by Microsoft Clarity, Persists the Clarity User ID and preferences, unique to that site, on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.
_clsk
Used by Microsoft Clarity, Connects multiple page views by a user into a single Clarity session recording.
SRM_I
Collects user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
SM
Use to measure the use of the website for internal analytics
CLID
The cookie is set by embedded Microsoft Clarity scripts. The purpose of this cookie is for heatmap and session recording.
SRM_B
Collected user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
_gid
This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected includes the number of visitors, the source where they have come from, and the pages visited in an anonymous form.
_ga_#
Used by Google Analytics, to store and count pageviews.
_gat_#
Used by Google Analytics to collect data on the number of times a user has visited the website as well as dates for the first and most recent visit.
collect
Used to send data to Google Analytics about the visitor's device and behavior. Tracks the visitor across devices and marketing channels.
AEC
cookies ensure that requests within a browsing session are made by the user, and not by other sites.
G_ENABLED_IDPS
use the cookie when customers want to make a referral from their gmail contacts; it helps auth the gmail account.
test_cookie
This cookie is set by DoubleClick (which is owned by Google) to determine if the website visitor's browser supports cookies.
_we_us
this is used to send push notification using webengage.
WebKlipperAuth
used by webenage to track auth of webenagage.
ln_or
Linkedin sets this cookie to registers statistical data on users' behavior on the website for internal analytics.
JSESSIONID
Use to maintain an anonymous user session by the server.
li_rm
Used as part of the LinkedIn Remember Me feature and is set when a user clicks Remember Me on the device to make it easier for him or her to sign in to that device.
AnalyticsSyncHistory
Used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries.
lms_analytics
Used to store information about the time a sync with the AnalyticsSyncHistory cookie took place for users in the Designated Countries.
liap
Cookie used for Sign-in with Linkedin and/or to allow for the Linkedin follow feature.
visit
allow for the Linkedin follow feature.
li_at
often used to identify you, including your name, interests, and previous activity.
s_plt
Tracks the time that the previous page took to load
lang
Used to remember a user's language setting to ensure LinkedIn.com displays in the language selected by the user in their settings
s_tp
Tracks percent of page viewed
AMCV_14215E3D5995C57C0A495C55%40AdobeOrg
Indicates the start of a session for Adobe Experience Cloud
s_pltp
Provides page name value (URL) for use by Adobe Analytics
s_tslv
Used to retain and fetch time since last visit in Adobe Analytics
li_theme
Remembers a user's display preference/theme setting
li_theme_set
Remembers which users have updated their display / theme preferences
We do not use cookies of this type.
_gcl_au
Used by Google Adsense, to store and track conversions.
SID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
SAPISID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
__Secure-#
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
APISID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
SSID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
HSID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
DV
These cookies are used for the purpose of targeted advertising.
NID
These cookies are used for the purpose of targeted advertising.
1P_JAR
These cookies are used to gather website statistics, and track conversion rates.
OTZ
Aggregate analysis of website visitors
_fbp
This cookie is set by Facebook to deliver advertisements when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
fr
Contains a unique browser and user ID, used for targeted advertising.
bscookie
Used by LinkedIn to track the use of embedded services.
lidc
Used by LinkedIn for tracking the use of embedded services.
bcookie
Used by LinkedIn to track the use of embedded services.
aam_uuid
Use these cookies to assign a unique ID when users visit a website.
UserMatchHistory
These cookies are set by LinkedIn for advertising purposes, including: tracking visitors so that more relevant ads can be presented, allowing users to use the 'Apply with LinkedIn' or the 'Sign-in with LinkedIn' functions, collecting information about how visitors use the site, etc.
li_sugr
Used to make a probabilistic match of a user's identity outside the Designated Countries
MR
Used to collect information for analytics purposes.
ANONCHK
Used to store session ID for a users session to ensure that clicks from adverts on the Bing search engine are verified for reporting purposes and for personalisation
We do not use cookies of this type.
Cookie declaration last updated on 24/03/2023 by Analytics Vidhya.
Cookies are small text files that can be used by websites to make a user's experience more efficient. The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies, we need your permission. This site uses different types of cookies. Some cookies are placed by third-party services that appear on our pages. Learn more about who we are, how you can contact us, and how we process personal data in our Privacy Policy.