Definition: Fully managed pub/sub messaging service for distributing notifications to multiple subscribers simultaneously.
— Source: NERVICO, Product Development Consultancy
What is Amazon SNS
Amazon SNS (Simple Notification Service) is a fully managed pub/sub (publish/subscribe) messaging service by AWS. It allows a publisher to send a message to a topic and have multiple subscribers receive it simultaneously through different channels: SQS queues, Lambda functions, HTTP endpoints, emails, or push notifications to mobile devices. Unlike a message queue where a single consumer processes each message, SNS distributes each message to all subscribers registered on the topic.
How It Works
The SNS pub/sub pattern is organized around topics. A publisher sends a message to a topic without knowing the subscribers. SNS handles distributing that message to all subscribed endpoints in parallel. Subscribers can filter messages using filter policies based on message attributes, receiving only those relevant to them. SNS supports messages up to 256 KB and can deliver millions of messages per second. For messages requiring ordering and deduplication, SNS offers FIFO topics that integrate directly with SQS FIFO queues.
Why It Matters
In distributed architectures, an event frequently needs to trigger actions across multiple services. Without a pub/sub service, the publisher would need to know and individually call each interested service, creating direct coupling. SNS completely decouples the publisher from subscribers: when a new service needs to react to an event, it simply subscribes to the topic without modifying the publisher. This pattern reduces system complexity and facilitates extending functionality without modifying existing code.
Practical Example
A logistics platform publishes an event to an SNS topic every time a package changes status. Three subscribers receive the message simultaneously: a Lambda function updates the tracking database, an SQS queue feeds the notification service that sends SMS to the customer, and an HTTP endpoint sends the update to the warehouse ERP system. When the team needs to add internal Slack alerts, they simply subscribe a new endpoint to the topic without touching the logistics service.