Amazon SNS: One Message, Many Listeners, Zero Coupling

Amazon SNS: One Message, Many Listeners, Zero Coupling

A deep, intermediate-level walkthrough of how Amazon Simple Notification Service turns a single event into fan-out delivery across queues, functions, endpoints, and people — without the publisher ever knowing who is listening.

Picture a radio station broadcasting a single signal into the air. The station never calls each listener individually, never knows how many radios are tuned in, and doesn’t care whether someone is listening in a car, a kitchen, or not at all right now. Every radio that is tuned to that frequency simply receives the broadcast the moment it goes out. Amazon SNS applies exactly this broadcast model to software systems: one publisher sends one message to one topic, and every subscriber tuned to that topic — a queue, a function, an inbox, a phone — receives its own copy, instantly and independently. This tutorial moves past the introductory pitch and examines how that fan-out actually works, scales, and stays reliable in production.

1Core Concepts at the Intermediate Level

Skipping the absolute basics — this chapter builds the mental model that the rest of this tutorial depends on.

The Coupling Problem SNS Solves

Without a pub/sub layer, a service that needs to notify five downstream systems ends up calling all five directly, which means it must know about all five, handle five sets of failures, and get rewritten every time a sixth system joins. SNS removes that coupling entirely: the publisher sends one message to a topic and never learns, or needs to learn, who or how many are subscribed underneath it.

Simple Analogy

A publisher shouting into a topic is like a teacher writing an announcement on a single notice board instead of walking to every classroom individually. Any class that has assigned someone to check that board gets the news at the same moment, and the teacher never needs to know which classes are currently paying attention.

Topics, Subscriptions, and Protocols

A “topic” is the named channel a publisher sends messages to. A “subscription” binds one specific endpoint — an SQS queue, a Lambda function, an HTTP/S endpoint, an email address, an SMS number, or a mobile push endpoint — to that topic. The “protocol” simply describes which of those delivery mechanisms a given subscription uses, and a single topic can freely mix several protocols among its subscribers at once.

Concept

Topic

The named broadcast channel that a publisher sends messages into, decoupled from who is listening.

Concept

Subscription

A binding between a topic and a specific endpoint that should receive a copy of every matching message.

Concept

Fan-Out

The pattern of one message reaching many independent subscribers simultaneously, each processing it on its own timeline.

Concept

Filter Policy

A rule attached to a subscription so it only receives the subset of messages relevant to it, not everything on the topic.

i
Key Mental Shift

SNS is push-based and near-instant, while SQS is pull-based and durable at rest. The two are frequently combined specifically because each covers the other’s weak point.

2Architecture and Components

SNS’s architecture is a thin, highly available routing layer sitting between a publisher and a set of independent subscriber endpoints.

Standard vs. FIFO Topics

A standard topic optimizes for throughput and best-effort ordering, occasionally delivering a message more than once. A FIFO topic guarantees strict ordering and exactly-once delivery within a message group, at the cost of lower throughput — and critically, a FIFO topic can only fan out to FIFO SQS queues, not to Lambda, HTTP, email, or mobile endpoints directly.

The Access Policy and Delivery Layer

Every topic has a resource-based access policy controlling who may publish or subscribe to it. Once a message is accepted, SNS’s internal delivery layer pushes it out to every matching subscription concurrently, applying each subscription’s filter policy independently before deciding whether that particular subscriber should receive a copy at all.

flowchart TB
    A[Publisher] -->|Publish Message| B[SNS Topic]
    B --> C{Filter Policy Evaluation}
    C -->|Match| D[SQS Queue Subscriber]
    C -->|Match| E[Lambda Function Subscriber]
    C -->|Match| F[HTTPS Endpoint Subscriber]
    C -->|Match| G[Email / SMS Subscriber]
    C -->|No Match| H[Message Skipped for That Subscriber]
    D --> I[(Durable storage until consumed)]
        
FIG 1 — One publish call, independently filtered and delivered to every matching subscriber.

Message Attributes as First-Class Routing Data

SNS messages carry a body plus a separate set of key-value message attributes. Filter policies are evaluated against those attributes, not the message body, which is why well-designed publishers always attach meaningful attributes such as event type or region rather than forcing subscribers to parse the body just to decide relevance.

3Internal Working

Understanding what happens between a Publish call and a subscriber receiving a message explains most of SNS’s guarantees and limitations.

The Publish Call Is Synchronous, Delivery Is Not

When a publisher calls Publish, SNS synchronously confirms the message was accepted and durably stored inside the service; it does not wait for every subscriber to actually receive it. Delivery to each subscription happens asynchronously and independently afterward, which is why a publisher’s success response says nothing about whether any particular subscriber has processed the message yet.

sequenceDiagram
    participant Pub as Publisher
    participant SNS as SNS Topic
    participant SQS as SQS Subscriber
    participant Lam as Lambda Subscriber
    Pub->>SNS: Publish(message, attributes)
    SNS-->>Pub: Accepted (MessageId)
    par Fan-out
        SNS->>SQS: Deliver copy
        SNS->>Lam: Invoke with copy
    end
    SQS-->>SNS: Enqueued
    Lam-->>SNS: Processed / Retry on failure
        
FIG 2 — Publish confirms acceptance; each subscriber’s delivery is a separate, independent path afterward.

Retry Behavior Differs by Protocol

SNS retries failed deliveries using a protocol-specific backoff policy: HTTP/S endpoints get a configurable retry policy with backoff, Lambda invocation failures are retried based on Lambda’s own asynchronous invocation retry behavior, and SQS deliveries almost never fail at the SNS layer since the queue simply durably stores whatever arrives.

Dead-Letter Queues Catch What Retries Cannot Fix

A subscription can be configured with a dead-letter queue, so that after retries are exhausted for that specific subscriber, the message is preserved for inspection instead of being silently dropped — a critical safety net for HTTP endpoints in particular, since those are the most likely to be temporarily unreachable.

4Data Flow and Lifecycle

Following one message from publish to final delivery clarifies how filtering and fan-out actually interact.

1

Message Published

A publisher sends a message body plus optional attributes to a topic, and SNS durably accepts and assigns it a message ID.

2

Subscription List Resolved

SNS looks up every current subscription on that topic at the moment of publish, since subscriptions can be added or removed at any time.

3

Filter Policies Applied

Each subscription’s own filter policy, if any, is evaluated against the message attributes to decide whether that subscriber receives a copy.

4

Independent Delivery Attempts

Each matching subscriber receives its own delivery attempt, on its own protocol-specific path, fully independent of every other subscriber’s outcome.

5

Retry or Dead-Letter

A failed delivery is retried per that protocol’s policy, and ultimately routed to a dead-letter queue if configured and retries are exhausted.

FIFO Ordering Is Scoped, Not Global

In a FIFO topic, ordering and deduplication are guaranteed only within the same message group ID, not across the entire topic. Two messages in different groups may still be delivered in either order relative to each other, which is an easy detail to miss when designing a FIFO-based workflow.

“A publisher speaks once; the topic decides, independently, who gets to hear it and how.”

5Advantages, Disadvantages and Trade-offs

SNS’s simplicity and speed come with trade-offs that matter once a system depends on it for correctness, not just convenience.

Advantages

  • Decouples publishers from subscribers entirely, so new consumers can be added with zero changes to the publisher.
  • Delivers near-instantly, which suits alerting and time-sensitive fan-out far better than a polling-based system.
  • Supports many delivery protocols from one topic, covering systems, humans, and mobile devices with one publish call.
  • Filter policies let each subscriber receive only relevant messages, avoiding unnecessary processing downstream.
  • Pay-per-use pricing with no idle infrastructure cost when no messages are flowing.

Disadvantages / Trade-offs

  • Standard topics offer at-least-once delivery, so subscribers must tolerate occasional duplicate messages.
  • Without a subscriber like SQS behind it, a message pushed to an unavailable endpoint can be lost once retries and any dead-letter queue are exhausted.
  • FIFO topics trade throughput and flexibility for ordering guarantees, and cannot fan out directly to Lambda or HTTP endpoints.
  • Debugging “why didn’t my subscriber get this message” often means checking filter policies first, which is an easy step to overlook.
Simple Analogy

A megaphone announcement reaches everyone in earshot instantly, but if someone briefly steps out of the room, they simply miss it — unless a recorder was running to capture it for them later, the way an SQS queue does.

6Performance and Scalability

SNS scales to extremely high publish rates, but a few design choices determine whether subscribers scale along with it.

Standard Topics Scale Nearly Without Limit

Standard topics are designed for very high throughput, automatically scaling the publish and delivery paths behind the scenes without the customer provisioning anything. The practical scaling ceiling is usually on the subscriber side — how fast a Lambda function or an HTTP endpoint can actually process the volume of fan-out it is receiving.

Fan-out
One publish reaches all matching subscribers
At-least-once
Standard topic delivery guarantee
Group-scoped
FIFO ordering guarantee boundary

FIFO Throughput Is Group-Bound

Because ordering is enforced per message group, a FIFO topic’s real throughput ceiling for any single group is lower than its aggregate topic throughput. Spreading messages across more message groups, when business logic allows it, is the standard way to scale a FIFO-based workload.

SNS-to-SQS Fan-Out as a Scaling Pattern

Fanning a single SNS topic out to multiple SQS queues, each feeding a different downstream service at its own pace, is one of the most common scaling patterns in event-driven architectures — it lets each consumer scale its own processing independently, buffered by its own queue.

7High Availability and Reliability

SNS is built to be highly available by default, but reliability of the overall workflow still depends on subscriber-side choices.

Multi-Availability-Zone by Design

SNS stores and routes messages redundantly across multiple Availability Zones within a Region as a managed service characteristic, so a single data-center-level failure does not threaten message durability inside the service itself.

Reliability Beyond SNS Depends on the Subscriber

SNS guarantees it will attempt delivery and retry per protocol, but true end-to-end reliability for anything mission-critical usually means pairing SNS with a durable subscriber like SQS, which persists the message until a consumer explicitly processes it, removing any dependency on that consumer being available at the exact moment of delivery.

Cross-Region Notification Patterns

Because SNS topics are regional, multi-region architectures typically publish into a regional topic per Region and coordinate cross-region visibility at the application or event-bus layer rather than assuming a single topic spans regions.

!
Common Misconception

People sometimes assume SNS guarantees a subscriber will eventually process every message. SNS guarantees delivery attempts and retries — durable processing guarantees come from what the subscriber does with the message, such as placing it in a queue.

8Security

Because a topic can broadcast sensitive events to many destinations, controlling who can publish and subscribe is central to using SNS safely.

Resource Policies Control Publish and Subscribe Rights

A topic’s access policy determines which principals can publish messages and which can create subscriptions against it. Left too permissive, any principal in an account — or worse, any AWS account — could publish arbitrary messages into a topic your systems trust, so this policy deserves the same scrutiny as any other resource-based policy.

Control

Topic Access Policy

Restrict publish and subscribe actions to specific accounts, roles, or services rather than leaving the default broad policy in place.

Control

Server-Side Encryption

Enable encryption at rest with a KMS key so message content stored briefly inside SNS is never held in plaintext.

Control

VPC Endpoints

Publish to SNS from within a VPC over PrivateLink so traffic never needs to leave the private network toward the public internet.

Control

Subscription Confirmation

Require explicit confirmation for HTTP/S, email, and similar endpoint subscriptions so a topic cannot be silently subscribed to by an unintended party.

Auditability by Default

Publish, subscribe, and topic management API calls are recorded automatically by CloudTrail, giving a queryable history of who created subscriptions and who published into a given topic — useful both for security review and for tracing an unexpected message back to its source.

!
Security Pitfall

Leaving a topic’s default access policy unmodified after creation is a common oversight, since the default can be broader than most teams intend once a topic starts carrying sensitive application events.

9Monitoring, Logging and Metrics

Visibility into publish volume, delivery success, and failure patterns is what turns SNS from a black box into a debuggable system.

CloudWatch Metrics per Topic and Subscription

SNS automatically publishes metrics such as the number of messages published, the number of notifications delivered, and the number of failed deliveries, broken down per topic and, for some metrics, per subscription protocol — letting a team alarm on a rising failure rate before it becomes a customer-visible incident.

Delivery Status Logging

Delivery status logging can be enabled per protocol to capture successful and failed delivery attempts in CloudWatch Logs, including HTTP response codes for HTTP/S subscribers, which is often the fastest way to diagnose why a specific endpoint keeps failing.

SignalWhere It SurfacesTypical Use
Publish/delivery countsCloudWatch MetricsAlarming on volume or failure-rate anomalies
Delivery status logsCloudWatch LogsRoot-causing a specific failing subscriber
API activityCloudTrailSecurity review, change tracking
Undelivered messagesDead-letter queueManual inspection and reprocessing

Closing the Loop with Alarms

A CloudWatch alarm on the number-of-notifications-failed metric can trigger a Lambda function or page an on-call engineer the moment a subscriber starts silently failing, long before anyone notices missing downstream activity.

10Deployment and Cloud Integration

SNS rarely stands alone — its real power shows up in how naturally it threads through the rest of an event-driven architecture.

SNS Fan-Out to SQS

The classic fan-out pattern subscribes multiple SQS queues to a single SNS topic, so one published event durably reaches every downstream service’s own queue, each processed at its own pace without competing for the same messages.

Mobile Push and Direct-to-Device Notifications

SNS integrates directly with mobile push notification services, letting a single publish reach iOS, Android, and other device platforms through platform application endpoints, which is a common way applications drive real-time mobile notifications without maintaining separate integrations per platform.

Infrastructure as Code Integration

Topics, subscriptions, filter policies, and access policies are all ordinary AWS resources, meaning they belong in the same infrastructure-as-code stack as everything else — keeping fan-out topology under version control instead of being wired together manually in a console.

Simple Analogy

Subscribing several SQS queues to one SNS topic is like a single news alert being copied into several people’s personal notebooks at once — each person can flip through their own notebook on their own schedule, without disturbing anyone else’s copy.

11Design Patterns and Anti-Patterns

A handful of recurring decisions separate SNS-based systems that stay reliable from ones that quietly lose messages.

ANTI-PATTERN-01 Avoid
Problem

Subscribing an HTTP endpoint directly to a critical topic with no dead-letter queue configured.

Why It’s Harmful

If that endpoint is briefly down when a message arrives, the message can be lost forever once retries are exhausted, with no record it ever existed.

Correct Approach

Attach a dead-letter queue to every subscription that matters, or route through SQS first so nothing depends on an endpoint being reachable at the exact moment of delivery.

ANTI-PATTERN-02 Avoid
Problem

Building a subscriber that assumes every message is unique and will never be seen twice.

Why It’s Harmful

Standard topics deliver at-least-once, so a subscriber without idempotent handling can silently double-process an event, such as sending a duplicate notification to a customer.

Correct Approach

Design subscriber logic to be idempotent, using a message ID or business key to detect and ignore duplicates.

ANTI-PATTERN-03 Avoid
Problem

Sending every event type through a single, unfiltered topic that every subscriber must fully parse to find what it cares about.

Why It’s Harmful

Every subscriber pays the processing cost of every message on the topic, even the vast majority it will immediately discard.

Correct Approach

Attach filter policies so each subscriber only receives the specific message attributes relevant to it, cutting unnecessary invocations and processing.

Good Pattern: SNS in Front of SQS

Use SNS purely for fan-out and let each downstream SQS queue handle durability and consumer-side pacing — combining the strengths of both services rather than picking one over the other.

Good Pattern: Attribute-Rich Publishing

Attach clear message attributes such as event type, source, and severity at publish time, so filter policies and downstream routing stay simple and explicit.

12Best Practices and Common Mistakes

A short, practical checklist tends to prevent the majority of real-world SNS incidents.

Best Practice

Pair Critical Topics with SQS

For anything that must not be lost, subscribe a durable SQS queue rather than relying solely on push-based endpoints.

Best Practice

Always Configure Dead-Letter Queues

Set a dead-letter queue on every subscription carrying business-critical events, not just the ones that have already caused an incident.

Best Practice

Use Filter Policies Aggressively

Push filtering logic into SNS itself rather than making every subscriber inspect and discard irrelevant messages.

Best Practice

Review Topic Access Policies Regularly

Periodically confirm that only intended principals can publish or subscribe, especially after a topic’s purpose or audience changes.

!
Common Mistake

Choosing a FIFO topic by default “to be safe,” then discovering it cannot fan out directly to Lambda or HTTP endpoints, forcing an unplanned redesign.

!
Common Mistake

Assuming a successful Publish response means every subscriber has received the message, when it only confirms SNS accepted it for delivery.

13Real-World and Industry Examples

SNS’s fan-out model becomes concrete once mapped onto the kind of event-driven architecture large platforms actually run.

E-Commerce Order Events

An order-placed event published once to a topic commonly fans out to inventory, billing, shipping, and analytics systems simultaneously, each subscribed through its own SQS queue so a slowdown in one downstream service never blocks another.

Operational Alerting

Platform teams route CloudWatch alarms through SNS to fan out simultaneously to a chat integration, an on-call paging system, and an email distribution list from a single alarm action.

Mobile Applications

Consumer applications with large user bases use SNS’s mobile push integration to fan a single backend event out to iOS and Android devices without maintaining separate push infrastructure per platform.

Multi-Team Event Buses

Organizations with many independent teams often expose a small set of well-documented SNS topics as an internal event bus, letting new teams subscribe to existing business events without ever touching the systems that produce them.

“The publisher’s job ends the moment it lets go of the message — everything after that is the topic’s problem to solve.”

14Frequently Asked Questions

Questions that come up repeatedly once teams move past introductory usage.

Q1What is the real difference between SNS and SQS?

SNS pushes messages out to many subscribers the moment they are published, while SQS holds messages durably in a queue until a consumer pulls them — they are frequently combined rather than treated as alternatives.

Q2Can a single message go to some subscribers but not others?

Yes, that is exactly what filter policies are for — each subscription can specify which message attributes it cares about, and only matching messages are delivered to it.

Q3Does SNS guarantee messages are delivered exactly once?

Standard topics guarantee at-least-once delivery, meaning duplicates are possible; only FIFO topics provide exactly-once delivery within a message group.

Q4What happens if a subscriber is deleted after a message is published but before delivery completes?

SNS resolves the subscription list at publish time, so a subscription removed after that point simply does not affect deliveries already in progress for that message.

Q5Can a FIFO topic deliver to a Lambda function directly?

No, FIFO topics can only fan out to FIFO SQS queues; reaching Lambda from a FIFO topic requires the FIFO queue to trigger the function afterward.

Q6How is a lost message typically recovered?

If a dead-letter queue was configured on the failing subscription, the message is preserved there for inspection and manual or automated reprocessing.

Q7Is there a direct cost for having a topic with no traffic?

SNS pricing is based on the number of requests and notifications delivered, so an idle topic with no publishes generates effectively no charge.

15Summary and Key Takeaways

Amazon SNS earns its place at the center of event-driven architectures by solving the coupling problem cleanly: a publisher speaks once, and the topic takes on the entire responsibility of deciding who hears it and how. Its architecture of independent, per-subscription delivery explains both its speed and its at-least-once delivery trade-off, while filter policies keep fan-out efficient rather than noisy. Real reliability, though, is a joint responsibility — SNS attempts delivery and retries, but durable end-to-end guarantees usually require pairing it with SQS on the receiving end.

Key Takeaways

  • Publishers never know their subscribers — that decoupling is the entire reason SNS exists.
  • Standard is fast, FIFO is ordered — choose based on whether ordering or throughput matters more for a given workload.
  • Filter policies scale fan-out efficiently — routing relevance decisions to SNS avoids wasted downstream processing.
  • Publish success is not delivery success — a confirmed publish only means SNS accepted the message, not that every subscriber received it.
  • Pair SNS with SQS for durability — push speed plus durable storage is the standard pattern for anything that cannot be lost.
  • Idempotent subscribers are non-negotiable — at-least-once delivery on standard topics makes duplicate handling a design requirement, not an edge case.
  • Access policies deserve the same scrutiny as any other resource policy — a topic is only as trustworthy as who can publish into it.