Advertisement
Beginner AWS, Amazon SNS (Simple Notification Service)

What is Amazon SNS and how does the publish subscribe messaging pattern work?

Short answer

Amazon SNS is a fully managed pub or sub messaging service that lets a publisher send a single message to a topic, which then automatically delivers that message to every subscriber currently attached to that topic, such as email addresses, SMS numbers, SQS queues, or Lambda…

Save AWS mock interview
Advertisement
AModel answer
Amazon SNS is a fully managed pub or sub messaging service that lets a publisher send a single message to a topic, which then automatically delivers that message to every subscriber currently attached to that topic, such as email addresses, SMS numbers, SQS queues, or Lambda functions, allowing you to fan out a single event to many different destinations without the publisher needing to know anything about who is subscribed.
Example

aws sns publish --topic-arn arn:aws:sns:us-east-1:123456789012:OrderAlerts --message 'New order received'

Real-world example
An online retailer publishes a single message to an SNS topic whenever a high value order is placed, and that one message is automatically delivered to the sales team's email, a Slack integration through Lambda, and a logging Lambda function all at once.
Likely follow-ups
  • What is the difference between SNS and SQS?
  • How many subscribers can a single SNS topic support?
Related topics