Amazon SNS

Amazon SNS: How One Message Reaches Everyone at Once

A complete, beginner-friendly guide to Amazon Simple Notification Service — what it is, how it works, and why it is the backbone of modern event-driven applications.

Imagine a school announcement system. The principal does not walk to every single classroom and repeat the same message by hand. Instead, they speak once into a microphone connected to speakers in every room, and every classroom hears it at the same moment. Amazon SNS works the same way for software systems. One application sends a message once, and SNS instantly delivers a copy of it to every system that is listening — whether that is one listener or a thousand.

1What Is Amazon SNS?

Let’s start with the plain, simple explanation before anything technical.

The Simple Definition

Amazon Simple Notification Service, or SNS, is a fully managed messaging service from Amazon Web Services. Its main job is to let one piece of software send a message and have that single message automatically delivered to many different destinations at once. This pattern is often called “publish-subscribe,” or “pub/sub” for short.

SNS does not care what kind of application is sending the message or what kind of applications are receiving it. It can deliver messages to other AWS services, to regular web addresses, to email inboxes, to mobile phones as push notifications, and even as text messages, all from the same single message.

Simple Analogy

Think of SNS like a radio station. The radio station broadcasts one signal. It does not know or care how many radios are tuned in, or where those radios are. Every radio that is tuned to that station simply hears the broadcast. SNS is exactly this, but for software messages instead of music.

Why It Exists

Before services like SNS existed, if one part of a system needed to tell three other parts about something happening, a developer had to write code that manually called each of those three parts, one at a time, and handle it if any one of those calls failed. As systems grew and needed to notify more and more parts, this manual approach became fragile, slow to change, and hard to maintain.

i
Where It’s Used

SNS is used any time one event needs to reach multiple independent systems at once — sending order confirmation emails and updating inventory and notifying a shipping service, all from a single “order placed” event.

A Practical Example

Imagine an online store. When a customer places an order, several unrelated things need to happen: an email confirmation must be sent, the warehouse system must be told to prepare the package, and the analytics system must log the sale. Instead of the checkout code calling all three systems directly, it publishes a single “OrderPlaced” message to an SNS Topic. All three systems subscribe to that Topic and each receives its own copy of the message, completely independent of one another.

2The Problem Before Pub/Sub Messaging

Understanding the old way of doing things makes it obvious why SNS matters.

Problem 1

Tightly Coupled Code

The sender had to know the exact address and details of every single receiver, making the systems dependent on one another.

Problem 2

Fragile Failures

If one receiving system was slow or down, it could delay or break the entire notification process for every other receiver too.

Problem 3

Hard to Add New Listeners

Adding a fourth system that also needed to know about the event meant changing and redeploying the original sending code.

Problem 4

No Built-In Retry Logic

Developers had to write their own retry and error-handling logic for every single receiver, again and again.

SNS solves all four problems at once. The sender only ever talks to one thing: the Topic. It has no idea who, or how many, are subscribed to it. New subscribers can be added or removed at any time without touching the sender’s code at all, and SNS automatically retries failed deliveries according to a built-in retry policy.

“The sender should never need to know who is listening — it should just need to know where to speak.”

3Core Concepts and Terminology

A handful of terms show up constantly when working with SNS. Let’s define each one clearly.

Term

Topic

A Topic is a named communication channel that messages are sent to. It acts as the single point of contact between publishers and subscribers.

Term

Publisher

A Publisher is any application or AWS service that sends a message into a Topic. It does not need to know who will receive it.

Term

Subscriber

A Subscriber is any endpoint that has registered to receive messages from a Topic, such as an email address, a queue, or a function.

Term

Subscription

A Subscription is the actual link connecting one Subscriber to one Topic, including any delivery preferences for that connection.

Term

Message

A Message is the actual piece of information being published — this could be plain text or a structured payload describing an event.

Term

Filter Policy

A Filter Policy is a rule attached to a Subscription that decides whether a given Subscriber should receive a particular message, based on its attributes.

Putting It Together

The Topic is the radio station. The Publisher is the person speaking into the microphone. Each Subscriber is a radio tuned to that station. The Subscription is the act of tuning in. A Filter Policy is like a radio that only plays through the speaker when the announcer says a specific keyword.

4Architecture and Components

Let’s see how these pieces are physically wired together.

At its core, SNS architecture is refreshingly simple: one Publisher, one Topic, and any number of Subscribers hanging off that Topic. AWS manages the durability, retries, and delivery mechanics of the Topic itself, so you never have to run any servers to make this work.

flowchart LR
    P[Publisher Application] --> T((SNS Topic))
    T --> S1[SQS Queue]
    T --> S2[Lambda Function]
    T --> S3[Email Subscriber]
    T --> S4[HTTPS Endpoint]
    T --> S5[Mobile Push]
        
FIG 1 — A single Topic fanning a message out to five different Subscriber types

This pattern of one message going to many destinations is commonly called “fan-out.” It is one of the most powerful reasons teams choose SNS: a single publish call can simultaneously trigger a Lambda function, drop a copy into an SQS queue for later processing, send an email, hit an HTTPS webhook, and push a mobile notification — all without the Publisher writing separate code for each one.

Standard Topics vs FIFO Topics

SNS offers two Topic types. Standard Topics prioritize very high throughput and best-effort ordering. FIFO Topics guarantee strict message ordering and exactly-once delivery, at a lower throughput, for cases where the sequence of events truly matters.

5Internal Working: The Message Delivery Flow

Let’s trace exactly what happens between the moment a message is published and the moment every Subscriber has it.

1

Publish

The Publisher sends a single message, along with optional attributes, to a specific Topic.

2

Store Durably

SNS stores the message redundantly across multiple facilities so it is not lost even if one part of the infrastructure has an issue.

3

Evaluate Filter Policies

For every Subscription on that Topic, SNS checks whether a Filter Policy is attached, and if so, whether this particular message matches it.

4

Fan Out Deliveries

SNS attempts delivery, in parallel, to every Subscriber whose filter allows the message through.

5

Retry on Failure

If a delivery attempt fails, SNS automatically retries according to a backoff schedule appropriate to that Subscriber type.

sequenceDiagram
    participant Pub as Publisher
    participant Topic as SNS Topic
    participant SubA as Subscriber A
    participant SubB as Subscriber B
    Pub->>Topic: Publish message
    Topic->>Topic: Store durably
    Topic->>Topic: Evaluate filter policies
    Topic->>SubA: Deliver message
    Topic->>SubB: Deliver message
    SubA-->>Topic: Acknowledge
    SubB-->>Topic: Acknowledge (or retry on failure)
        
FIG 2 — How a single published message reaches two independent Subscribers
!
Common Misunderstanding

SNS delivers a separate copy of the message to each Subscriber independently. One Subscriber being slow or failing does not block or delay delivery to any of the other Subscribers.

6Getting Started: Setting Up SNS

Here is the conceptual sequence for setting up your first Topic and Subscription.

1

Create a Topic

Choose a name and decide whether it should be a Standard Topic or a FIFO Topic, based on whether strict ordering matters for your use case.

2

Set an Access Policy

Define who is allowed to publish to the Topic and who is allowed to subscribe to it.

3

Add Subscriptions

Register each destination that should receive messages — an email address, a queue, a function, or an HTTPS endpoint.

4

Confirm Subscriptions

Some Subscriber types, like email, require the destination to confirm they actually want to receive messages before delivery begins.

5

Apply Filter Policies (Optional)

If a Subscriber should only receive certain kinds of messages, attach a Filter Policy to its Subscription.

6

Publish a Test Message

Send a sample message to the Topic and confirm every intended Subscriber receives it as expected.

7Fan-Out, Subscriber Types and Message Filtering

This is where SNS truly shines: reaching many different kinds of destinations from one single message.

Subscriber TypeTypical Use
Amazon SQS QueueReliable, decoupled processing at the receiver’s own pace
AWS Lambda FunctionInstant, serverless reaction to an event
Email / Email-JSONHuman notifications, alerts, and reports
SMSTime-sensitive text alerts sent directly to phones
HTTPS / HTTP EndpointNotifying external systems or webhooks
Mobile PushPush notifications to iOS and Android apps

Because a single Topic can have many Subscriptions of completely different types at once, one event can simultaneously trigger a background job, alert an on-call engineer by SMS, and notify a partner’s system by webhook — all through separate, independent Subscriptions.

Message Filtering

Not every Subscriber wants every message. A Filter Policy lets a Subscriber say, in effect, “only send me messages tagged as urgent” or “only send me messages about the payments service.” SNS checks this policy automatically for every message and skips delivery to that Subscriber if it does not match, saving the receiving system from having to filter out irrelevant messages itself.

Example: Order Events

A single “OrderEvents” Topic might have one Subscriber that only wants messages where the order value is above a certain amount, and another Subscriber that wants every single order event regardless of value — both achieved purely through Filter Policies, with no changes to the Publisher.

8Advantages, Disadvantages and Trade-offs

A balanced look at where SNS excels and where it has limits.

Advantages

  • Decouples senders from receivers completely
  • Delivers to many different destination types from one message
  • Built-in retries and durable storage of messages
  • New Subscribers can be added with zero changes to the Publisher
  • Message filtering avoids unnecessary processing on receivers
  • Scales automatically with no servers to manage

Disadvantages / Trade-offs

  • Standard Topics do not guarantee strict message ordering
  • Not designed to store messages for later — undelivered messages are not queued indefinitely for slow Subscribers the way a queue would be
  • FIFO Topics have lower throughput limits than Standard Topics
  • Cost can grow with very high message volumes and many Subscribers

9Performance and Scalability

SNS is built to handle sudden, massive bursts of messages without any manual scaling effort.

Because SNS is fully managed, it automatically scales the underlying infrastructure to absorb spikes in publishing volume. A Topic that normally receives a handful of messages per minute can suddenly receive thousands per second during a flash sale or an incident, and SNS handles the fan-out to every Subscriber without you provisioning any additional capacity in advance.

Simple Analogy

A radio station does not need to hire more announcers just because more people turned on their radios. SNS behaves the same way — adding more Subscribers does not slow down the Publisher at all.

1:N
one message can fan out to many Subscribers
Auto
scaling with no servers to manage
Multi
protocol delivery in a single publish call

10Security in Amazon SNS

Since messages often carry meaningful business data, SNS provides several layers of protection.

Protection

Encryption In Transit

All communication with SNS happens over encrypted connections using TLS.

Protection

Encryption At Rest

Topics can be configured to encrypt stored messages using a managed encryption key.

Protection

Access Policies

Each Topic has its own policy defining exactly which accounts or roles are allowed to publish or subscribe.

Protection

IAM Integration

Fine-grained AWS Identity and Access Management permissions control who can create, modify, or delete Topics and Subscriptions.

!
Common Mistake

Leaving a Topic’s access policy open to “anyone” while testing, and forgetting to lock it back down before going to production, can allow unintended publishers or subscribers.

11Monitoring, Logging and Metrics

Knowing whether your messages actually arrived is just as important as sending them.

SNS automatically reports detailed metrics to Amazon CloudWatch for every Topic, including how many messages were published, how many were successfully delivered, and how many failed. Delivery status logging can also be enabled per Subscriber type, giving a per-message record of exactly what happened during delivery.

Metric

Number Of Messages Published

How many messages a Topic has received from Publishers over a given period.

Metric

Number Of Notifications Delivered

How many individual deliveries to Subscribers succeeded.

Metric

Number Of Notifications Failed

How many delivery attempts ultimately failed after all retries were exhausted.

Metric

Publish Size

The size of published messages, useful for tracking usage and spotting unusually large payloads.

i
Tip

Setting a CloudWatch alarm on the failed-notifications metric lets your team catch a broken Subscriber, such as an expired webhook, almost immediately instead of discovering it days later.

12Best Practices and Common Mistakes

A few hard-earned lessons that save teams from painful surprises later.

ANTI-PATTERN-01 Avoid
Problem

Using SNS alone as a replacement for a queue, expecting a slow or offline Subscriber to eventually catch up on every message it missed.

Why It’s Harmful

SNS focuses on immediate delivery with retries over a limited window, not indefinite storage, so a Subscriber that is down for an extended period can miss messages entirely.

Correct Approach

Pair SNS with an SQS queue as the Subscriber when a receiver needs to reliably process every message at its own pace, even after downtime.

ANTI-PATTERN-02 Avoid
Problem

Sending every possible event to a single, unfiltered Topic and letting each Subscriber sort through all the noise itself.

Why It’s Harmful

This wastes processing time on every Subscriber and makes it hard to reason about which messages actually matter to which system.

Correct Approach

Use Filter Policies so each Subscription only receives the specific messages it actually cares about, keeping downstream systems simpler and more efficient.

It also helps to give Topics clear, descriptive names, document which team owns each Topic, and use a FIFO Topic instead of a Standard Topic whenever the exact order of events genuinely changes the outcome, such as processing account balance updates.

13Real-World and Industry Examples

Seeing SNS in familiar contexts helps the concept stick.

E-Commerce Order Processing

Retail platforms commonly publish a single “order placed” event to SNS, which then fans out to inventory systems, shipping systems, and customer notification systems simultaneously.

Operational Alerting

Monitoring systems publish alarm events to SNS Topics that fan out to on-call engineers by SMS or email, and to incident management tools through HTTPS endpoints, all from a single alarm trigger.

Mobile Applications

Apps use SNS mobile push Subscriptions to notify users of new messages, promotions, or account activity across both iOS and Android from one shared backend event.

Media and Streaming Platforms

Streaming services use SNS-driven fan-out to trigger multiple independent processing steps — such as thumbnail generation, transcoding, and content moderation — the moment a new video finishes uploading.

14Frequently Asked Questions

Quick, clear answers to the questions beginners ask most often.

Q1Is SNS the same thing as SQS?

No. SNS is a publish-subscribe service that fans a message out to many Subscribers at once. SQS is a queue that holds messages for a single consumer to process at its own pace. They are often used together.

Q2What happens if a Subscriber is offline when a message is published?

SNS retries delivery for a period of time according to its retry policy, but it is not designed to store messages indefinitely, so pairing it with an SQS queue is recommended for guaranteed processing.

Q3Can one message go to email, SMS, and a function all at once?

Yes. As long as each destination is set up as a Subscription on the same Topic, a single publish delivers to all of them independently.

Q4Do I need to change my Publisher’s code to add a new Subscriber?

No. Adding or removing a Subscriber only requires managing Subscriptions on the Topic — the Publisher’s code never needs to change.

Q5What is the difference between a Standard Topic and a FIFO Topic?

Standard Topics offer very high throughput with best-effort ordering, while FIFO Topics guarantee strict ordering and exactly-once delivery at a lower throughput.

Q6How does message filtering help?

It lets each Subscriber receive only the messages relevant to it, based on message attributes, instead of every message published to the Topic.

15Summary and Key Takeaways

Amazon SNS solves a problem every growing system eventually runs into: how do you tell many independent parts of your application about something that just happened, without tightly wiring them all together? By introducing a simple Topic in the middle, SNS lets Publishers speak once while any number of Subscribers — queues, functions, emails, texts, webhooks, and mobile devices — listen independently, each receiving their own reliable copy of the message. Combined with automatic retries, optional message filtering, and native CloudWatch monitoring, SNS turns what used to be fragile, hand-written notification code into a flexible, scalable, and easily observable part of any event-driven system.

Key Takeaways

  • SNS is a publish-subscribe messaging service — one message, many independent destinations.
  • Publishers and Subscribers are fully decoupled — the sender never needs to know who is listening.
  • Fan-out is the core superpower — a single message can reach queues, functions, emails, SMS, and webhooks at once.
  • Filter Policies reduce noise — Subscribers only receive the messages that actually matter to them.
  • Standard Topics favor throughput; FIFO Topics favor strict ordering — choose based on whether sequence matters.
  • SNS is not long-term storage — pair it with SQS when a Subscriber must never miss a message, even after downtime.
  • Monitoring is built in — CloudWatch metrics reveal publish and delivery success or failure without extra setup.