ENES

Amazon SNS

One message in, many copies out: a megaphone for systems.

One message entering a topic and copies fanning out to a function, a queue, an email and a phone

Amazon SNS (Simple Notification Service) is a publish/subscribe service. You create a topic, several subscribers sign up to it, and every message published to the topic is delivered to all of them at once. A subscriber can be an AWS Lambda function, an Amazon SQS queue, an HTTPS endpoint, an email address or a phone number (SMS).

The difference with a queue: Amazon SQS hands each message to one consumer; a topic copies each message to every subscriber. The two are often combined: SNS fans an event out to several SQS queues, each owned by a different team, and each team processes it at its own pace.

Example: when an order is paid, the shop publishes 'order 4521 paid' to a topic. The warehouse queue receives it, the invoicing function receives it, the analytics pipeline receives it, and the customer gets an SMS. The checkout code published once and has no idea who is listening.

SNS is also how Amazon CloudWatch alarms reach people: the alarm publishes to a topic, and the topic emails or texts whoever is on call.

Keep in mind

Go deeper

Related terms

More in AWS