28 November 2020

AWS-SNS

  • It is a web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients.
  • And makes it easy to set up, operate, and send a notification from the cloud.
  • It follows the publish-subscribe(pub-sub) messaging paradigm with notification being delivered to the client using a push mechanism. 
  • To prevent the message from being lost, all messages published to Amazon SNS are stored redundantly across multiple Availability Zones.
  • SNS is push and SQS is poll.
  • SNS has three major components - Publisher, Topic and Subscriber

Publisher

  • The entity that triggers the sending of a message(e.g. CloudWatch Alarm, Any application or S3 events)
  • Publishers are also known as producers that produce and send the message to the SNS which is a logical access point

Topic

  • Object to which you publish your message
  • Subscriber subscribe to the topic to receive the message
  • By default, SNS offers 100,000 topics per account (Soft limit)
  • With the exception of SMS messages, Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text

Subscriber

  • An endpoint to a message is sent. Message are simultaneously pushed to the subscriber.
  • Subscribers such as web servers, email addresses, Amazon SQS queues, AWS Lambda functions receive the message or notification from the SNS over one of the supported protocols (Amazon SQS, email, Lambda, HTTP, SMS).
  • Subscriber subscribe to the topic to receive the message.
  • By default, SNS offers 10 million subscriptions per topic (Soft limit).
  • SQS and SNS are lightweight, fully managed message queue and topic services that scale almost infinitely and provide simple, easy-to-use APIs. 
  • You can use Amazon SQS and SNS to decouple and scale micro services, distributed systems, and serverless applications, and improve reliability.

Benefits of SNS

  • Instantaneous delivery - SNS is based on push-based delivery. This is the key difference between SNS and SQS. SNS is pushed once you publish the message in a topic and the message is delivered to multiple subscribers.
  • Flexible - SNS supports multiple endpoint types. Multiple endpoint types can receive the message over multiple transport protocols such as email, SMS, Lambda, Amazon SQS, HTTP, etc.
  • Inexpensive - SNS service is quite inexpensive as it is based on pay-as-you-go model, i.e., you need to pay only when you are using the resources with no up-front costs.
  • Ease of use - SNS service is very simple to use as Web-based AWS Management Console offers the simplicity of the point-and-click interface.
  • Simple Architecture - SNS is used to simplify the messaging architecture by offloading the message filtering logic from the subscribers and message routing logic from the publishers. Instead of receiving all the messages from the topic, SNS sends the message to subscriber-only of their interest.

No comments:

Post a Comment

Most views on this month