{"id":175616,"date":"2023-12-22T22:47:01","date_gmt":"2023-12-22T21:47:01","guid":{"rendered":"https:\/\/liora.io\/en\/?p=175616"},"modified":"2026-08-09T18:49:29","modified_gmt":"2026-08-09T17:49:29","slug":"amazon-sns-the-messaging-service-connected-to-aws","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/amazon-sns-the-messaging-service-connected-to-aws","title":{"rendered":"Amazon SNS: The messaging service connected to AWS"},"content":{"rendered":"\n<p><strong>Amazon SNS is a service for sending push notifications from an application to the end user or other programs.<\/strong><\/p>\n\n\n<p>It&#8217;s a comprehensive messaging service that enables communication between applications (<strong>A<\/strong>application<strong> T<\/strong>o <strong>A<\/strong>application ,  <strong>A2A<\/strong>) or persons (<strong>A<\/strong>application <strong>T<\/strong>o <strong>P<\/strong>erson ,  <strong>A2B<\/strong>). It allows you to create topics (i.e. subjects) that will be the logical access and communication channel. <\/p>\n\n\n<p>SNS uses the <strong>pub\/sub<\/strong> paradigm (<strong>publish \/ subscribe<\/strong>) for message delivery. This principle establishes that publishers (<strong>publishers<\/strong>) send messages via common communication channels called &#8220;topic&#8221; (<strong>topic<\/strong>), while subscribers (<strong>subscribers<\/strong>) automatically receive messages corresponding to the topics for which they are subscribed.<\/p>\n\n\n<p>We can visualize the <strong>topics<\/strong> as a virtual &#8220;mailbox&#8221; that allows individual subscribers to retrieve messages without having to communicate directly with the editors. In this way, each subscriber can specify the types of messages they wish to receive, via their various subscriptions.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Source : aws.amazon.com\" decoding=\"async\" height=\"1280\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image4-5.png\" style=\"width:100%;height:auto\" width=\"1280\"\/><figcaption class=\"wp-element-caption\">Source : aws.amazon.com<\/figcaption><\/figure>\n\n\n<h2 class=\"wp-block-heading\" id=\"definition-of-important-terminology\">Definition of important terminology <\/h2>\n\n\n<p>It&#8217;s important to understand certain terms related to messaging services before proceeding. The<strong> table below will help you understand these key terms:<\/strong><\/p>\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table>\n<thead>\n<tr>\n<th>Term<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Publisher<br\/><img alt=\"Illustration for Definition of important terminology\" decoding=\"async\" height=\"50\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image7-5.png\" width=\"50\"\/><\/td>\n<td>\n<ul>\n<li>The publisher is the entity responsible for sending messages on various topics and endpoints. We can think of a publisher as a person who sends messages to a mailbox.<\/li>\n<\/ul>\n<ul><ul>\n<li>Endpoints can be emails, SMS, HTTP, mobile applications, or other Amazon services (such as Lambda or SQS).<\/li>\n<\/ul><\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">Subscriber<br\/><img alt=\"Illustration for Definition of important terminology\" decoding=\"async\" height=\"50\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image12-1.png\" width=\"50\"\/><\/td>\n<td rowspan=\"3\">\n<ul>\n<li>The subscriber is the entity that receives published messages on a topic. We can think of the subscriber as a person who retrieves their mail from their mailbox.<\/li>\n<\/ul>\n<ul><ul>\n<li>Subscribers subscribe to a topic in order to receive messages.<\/li>\n<li>By default, SNS offers 10 million subscriptions per topic.<\/li>\n<\/ul><\/ul>\n<\/td>\n<\/tr>\n<tr>\n<\/tr>\n<tr>\n<\/tr>\n<tr>\n<td rowspan=\"3\">Topic<br\/><img alt=\"Illustration for Definition of important terminology\" decoding=\"async\" height=\"50\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image13-1.png\" width=\"50\"\/><\/td>\n<td rowspan=\"3\">\n<ul>\n<li>The topic is the communication channel that allows publishers to publish their messages and subscribers to receive them. We could imagine this as a shared mailbox among several people, where each person can receive letters addressed to them.<\/li>\n<\/ul>\n<ul><ul>\n<li>By default, SNS offers 100,000 topics per account.<\/li>\n<li>Except for SMS messages, Amazon SNS messages can contain a maximum of 256 KB of text data, including XML, JSON, or plain text format.<\/li>\n<\/ul><\/ul>\n<\/td>\n<\/tr>\n<tr>\n<\/tr>\n<tr>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n<p>The diagram below perfectly illustrates the elements provided above:<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:694px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Source : aws.amazon.com\" decoding=\"async\" height=\"390\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image8-1.png\" style=\"width:694px;max-width:100%;height:auto\" width=\"694\"\/><figcaption class=\"wp-element-caption\">Source : aws.amazon.com<\/figcaption><\/figure>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-the-features-of-aws-sns\">What are the features of AWS SNS?<\/h2>\n\n\n<p>Here are some of the key features of AWS SNS:<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>Scaling:<\/strong> the service automatically adapts to growing message volume requirements.<\/li><li><strong>Message encryption:<\/strong> message protection is a priority SNS protects all messages according to encryption models. They are automatically decrypted once transmitted to the recipient&#8217;s endpoint.<\/li><li><strong>Message filtering:<\/strong> the subscriber can change the filtering policy to receive only relevant notifications.<\/li><li><strong>Replication:<\/strong> when a message is sent to a topic, it is replicated on several endpoints.<\/li><li><strong>Mobile notification:<\/strong> actions from the application (initiated by your users) or from cloud-based business logic can be triggered<\/li><li><strong>Email<\/strong>: Amazon SNS can send mail messages (SMTP)<\/li><\/ul>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-5ee10de4\" style=\"margin-top:32px;margin-bottom:32px\"><div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/cloud-dev\/aws-solutions-architect\">Ma\u00eetriser les fonctionnalit\u00e9s d&#8217;AWS SNS<\/a><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"comparison-between-sns-and-sqs\">Comparison between SNS and SQS<\/h2>\n\n\n<p>These are two messaging services offered by Amazon Web Services. The table below will help you understand the differences:<\/p>\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Amazon SNS<br\/><img alt=\"Icon for Feature\" decoding=\"async\" height=\"60\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image2-4.png\" width=\"60\"\/><\/th>\n<th>Amazon SQS<br\/><img alt=\"Icon for Feature\" decoding=\"async\" height=\"300\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image1-6.png\" width=\"248\"\/><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Model<\/td>\n<td>Pub \/ Sub<\/td>\n<td>Queue<\/td>\n<\/tr>\n<tr>\n<td>Primary Use<\/td>\n<td>Sending messages and notifications to multiple recipients<\/td>\n<td>Queue management for message delivery<\/td>\n<\/tr>\n<tr>\n<td>Distribution<\/td>\n<td>All subscribers receive messages<\/td>\n<td>Messages are consumed by one consumer at a time<\/td>\n<\/tr>\n<tr>\n<td>Communication Protocols<\/td>\n<td>HTTP, HTTPS, email, SMS, mobile, push, etc.<\/td>\n<td>Amazon SQS, HTTP, HTTPS<\/td>\n<\/tr>\n<tr>\n<td>Message Format<\/td>\n<td>JSON, XML, plain text, etc.<\/td>\n<td>JSON, XML, plain text, etc.<\/td>\n<\/tr>\n<tr>\n<td>Message Processing<\/td>\n<td>No built-in processing, but can be coupled with Amazon AWS Lambda<\/td>\n<td>Built-in processing via customizable processing workers<\/td>\n<\/tr>\n<tr>\n<td>Capacity Management<\/td>\n<td>Dynamically adjustable<\/td>\n<td>Managed by the number of workers and the number of queues<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n<p>In short, Amazon SNS is designed to send messages to multiple recipients via a pub\/sub messaging model, while Amazon SQS is designed to manage message queues, with a FIFO (first-in, first-out) messaging model.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:720px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for Comparison between SNS and SQS\" decoding=\"async\" height=\"446\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image10-1.png\" style=\"width:720px;max-width:100%;height:auto\" width=\"720\"\/><\/figure>\n\n\n<p>They can be <strong>used together to create a complex, highly scalable messaging architecture.<\/strong><\/p>\n\n\n<p>As we have just seen, <strong>SNS enables a message to be published to different supported endpoints. When an SQS queue subscribes to an SNS topic<\/strong>, every message sent by that SNS topic joins the queue, along with the message body and its various attributes.<\/p>\n\n\n<p>The message is then almost guaranteed to be correctly distributed. &#8220;Almost&#8221;, because the SQS queue may be unavailable. In this case, Amazon SNS will make new attempts (exactly 100,010 attempts over 23 days) before the message is deleted.<\/p>\n\n\n<p>If your queue is unavailable for such a long time, you most likely have a problem with your messaging infrastructure.<\/p>\n\n\n<p>For more information on Amazon SQS, read our article on the subject.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-can-i-integrate-aws-sns\">How can I integrate AWS SNS? \n<\/h2>\n\n\n<p>As you probably know, one of the great strengths of Amazon AWS is the possible integration and joint operation between its various services. SNS is no exception to this rule, and can be easily integrated with different AWS services to create a complete system. Here are a few examples of possible integrations.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for How can I integrate AWS SNS?\" decoding=\"async\" height=\"800\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image5-5.png\" style=\"width:100%;height:auto\" width=\"800\"\/><\/figure>\n\n\n<p>Amazon SNS messages can be used as triggers for AWS Lambda functions that perform various operations.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:248px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for How can I integrate AWS SNS?\" decoding=\"async\" height=\"300\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image1-7.png\" style=\"width:248px;max-width:100%;height:auto\" width=\"248\"\/><\/figure>\n\n\n<p>As we&#8217;ve just discussed, Amazon SNS and SQS are often used together, one for publishing messages, the other for queuing them.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for How can I integrate AWS SNS?\" decoding=\"async\" height=\"1999\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image3-5.png\" style=\"width:100%;height:auto\" width=\"1765\"\/><\/figure>\n\n\n<p>If an EC2 instance, database or other resource fails, Amazon SNS can be used to alert system administrators via Cloudwatch.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\" style=\"width:119px;max-width:100%;margin-top:32px;margin-right:auto;margin-bottom:32px;margin-left:auto\"><img alt=\"Illustration for How can I integrate AWS SNS?\" decoding=\"async\" height=\"144\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image6-5.png\" style=\"width:119px;max-width:100%;height:auto\" width=\"119\"\/><\/figure>\n\n\n<p>Amazon SNS can publish notifications of events related to the infrastructure (AWS Elastic Beanstalk service, for example).<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"margin-top:32px;margin-bottom:32px\"><img alt=\"Illustration for How can I integrate AWS SNS?\" decoding=\"async\" height=\"1436\" loading=\"lazy\" src=\"https:\/\/liora.io\/app\/uploads\/2023\/03\/image11-1.png\" style=\"width:100%;height:auto\" width=\"1200\"\/><\/figure>\n\n\n<p>Your users using your S3 resources can be notified of new events (uploading or modifying information in an S3 bucket, for example).<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p>AWS SNS is a powerful and versatile messaging tool that enables messages to be sent to multiple endpoints (such as email, SMS, SQS queues, mobile applications, etc.). Amazon SNS can also be integrated with other AWS services to create resilient, scalable communication architectures.<\/p>\n\n\n<div class=\"wp-block-group has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-7441ce17 wp-block-group-is-layout-constrained\" style=\"border-left-color:#ff5c43;border-left-width:4px;border-radius:12px;background-color:#fff5f2;margin-top:32px;margin-bottom:32px;padding-top:24px;padding-right:28px;padding-bottom:24px;padding-left:28px\">\n\n<p style=\"margin-top:0;margin-bottom:16px;font-size:clamp(14.642px, 0.915rem + ((1vw - 3.2px) * 0.575), 22px);font-style:normal;font-weight:600\">Related articles<\/p>\n\n\n<ul class=\"wp-block-list\" style=\"margin-top:0;margin-bottom:0;padding-left:20px\">\n<li><a href=\"https:\/\/liora.io\/en\/aws-elastic-load-balancer-the-solution-that-distributes-network-traffic\" rel=\"noopener\" target=\"_blank\">AWS Elastic Load Balancer: The solution that distributes network traffic<\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/jam-aws-the-playful-learning-platform-from-amazon\" rel=\"noopener\" target=\"_blank\">Jam AWS: The playful Amazon learning platform<\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/aws-lambda-introduction-to-the-serverless-function\" rel=\"noopener\" target=\"_blank\">AWS Lambda: Introduction to the Serverless Function<\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/aws-certification-what-is-it-and-how-do-i-get-it\" rel=\"noopener\" target=\"_blank\">AWS Certification: What is it and how do I get it? <\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/aws-sagemaker-a-guide-for-using-the-platform\" rel=\"noopener\" target=\"_blank\">AWS SageMaker: A guide for using the platform<\/a><\/li>\n<li><a href=\"https:\/\/liora.io\/en\/5-aws-launches-and-announcements-making-developers-life-easy-in-2022\" rel=\"noopener\" target=\"_blank\">5 AWS launches and announcements making developers\u2019 life easy in 2022<\/a><\/li>\n<\/ul>\n\n<\/div>\n\n\n<p>Now that you know everything there is to know about Amazon SNS, you can start learning. To do so, take a look at the Liora training course dedicated to Amazon Web Service.<\/p>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-5ee10de4\" style=\"margin-top:32px;margin-bottom:32px\"><div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"\/en\/courses\/cloud-dev\/aws-solutions-architect\">Discover AWS training from Liora<\/a><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Amazon SNS is a service for sending push notifications from an application to the end user or other programs. It&#8217;s a comprehensive messaging service that enables communication between applications (Aapplication To Aapplication , A2A) or persons (Aapplication To Person , A2B). It allows you to create topics (i.e. subjects) that will be the logical access [&hellip;]<\/p>\n","protected":false},"author":76,"featured_media":175617,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2434],"class_list":["post-175616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-dev"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/175616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/76"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=175616"}],"version-history":[{"count":4,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/175616\/revisions"}],"predecessor-version":[{"id":210970,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/175616\/revisions\/210970"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/175617"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=175616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=175616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}