Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
Publish once to a topic, and SNS pushes a copy to every subscriber: SQS queues, Lambda functions, HTTPS endpoints, email, SMS and mobile apps.
Where SNS takes you5 steps, all open
Amazon SNS delivers messages from publishers to subscribers. A publisher sends a message to a topic, and SNS pushes a copy to every subscription: to applications through SQS queues, Lambda functions, HTTPS endpoints and Data Firehose, or to people through email, SMS and mobile push.
Fan-out. Publish an order once, and a fulfilment queue, an analytics queue and a receipts function each get their own copy to work on in parallel. A filter policy lets a subscriber receive only the messages it cares about.
A news wire. A reporter files a story once, and the wire pushes it at the same moment to every newspaper that subscribed, each getting its own copy. Some papers take only the sport. A paper whose line is down gets the story again and again until it comes through, or it goes into a tray to be dealt with later.
TopicPublishSubscriptionFilter policyDelivery policyDead-letter queueIs the message at most 256 KiB? Larger payloads go through the Extended Client Library, which keeps them in S3.
Does this subscription's filter policy match the message's attributes or body? With no filter policy, every message matches.
Can the endpoint take it? Server-side errors are retried; client-side errors, such as a deleted endpoint, are not.
Pick a case to follow the message through each check.
One publish, three jobs. The checkout publishes once; fulfilment, analytics and receipts each get their own copy, and none waits for another.
Queues set their own pace. With SQS queues subscribed, each consumer reads at its own speed, and messages wait in the queue if the consumer is down.
Filtering at the topic. The analytics subscription's filter policy passes only large orders, so its queue never sees the rest.
A dead-letter queue per subscription. Messages the receipts subscription cannot deliver land in an SQS queue in the same account and Region, instead of being discarded.
Encryption at rest with KMS. Server-side encryption protects message bodies with the AWS managed key for SNS or a customer managed key. It does not cover topic metadata, message attributes or metrics.
HTTPS on encrypted topics. Every request to a topic with server-side encryption must use HTTPS and Signature Version 4.
Encrypted queues as subscribers, or as dead-letter queues, need a customer managed KMS key whose key policy lets the SNS service principal use it.
Private publishing. SNS supports message privacy through VPC endpoints with AWS PrivateLink.
Standard topics are charged per million API requests, each 64 KB of published data counting as one request, plus deliveries priced by endpoint type.
Deliveries to SQS and Lambda carry no per-message delivery charge; data transfer still applies.
FIFO topics are charged per published and delivered message, plus the payload data.
Extras: filtering on message bodies, archiving and replay, data protection, and SMS priced by destination country.
Prices change, so none are printed here. Check the SNS pricing page on aws.amazon.com.
| Service | Delivers | Consumers | Choose it when |
|---|---|---|---|
| SNS | Pushes each message to every subscriber | Many, each with its own copy | One event, many reactions |
| SQS | Holds each message until a consumer takes it | Consumers that poll | Work pulled at the consumer's own pace |
| Topic type | Subscribers | Throughput | Choose it when |
|---|---|---|---|
| Standard | SQS, Lambda, HTTPS, Firehose, email, SMS, mobile push | Up to 30,000 messages a second per account in us-east-1 | Most fan-out and notifications |
| FIFO | SQS FIFO and standard queues only | 300 messages a second per message group, 3,000 per topic by default | Order and deduplication matter |
| Endpoints | Retry policy | Attempts |
|---|---|---|
| SQS, Lambda | Set by AWS | 100,015, over 23 days |
| SMTP, SMS, mobile push | Set by AWS | 50, over 6 hours |
| HTTP/S | Your own, within 3,600 seconds in total | Set per topic or subscription |
send the same message to several SQS queues at onceSNS fan-out
Each subscribed queue gets its own copy.
each consumer should receive only some kinds of messageSubscription filter policies
Matched on message attributes or the body; without one, a subscriber gets everything.
strict order and no duplicates, fanned out to queuesAn SNS FIFO topic with SQS FIFO queues
A deduplication ID repeated within 5 minutes is accepted but not delivered again.
a FIFO topic delivering straight to Lambda or emailNot possible
FIFO topics deliver only to SQS queues; put a queue in front of the function.
undeliverable messages must not be lostA dead-letter queue on the subscription
Without one, SNS discards a message once its retries end.
publish a 5 MB payloadS3 with the Extended Client Library
Messages stop at 256 KiB.
the queue wants the plain message, without SNS's JSON around itRaw message delivery
Supported for SQS, Firehose and HTTP/S subscriptions.
encrypt messages at rest in the topicServer-side encryption with KMS
It encrypts message bodies, not metadata or attributes.
a consumer must pull work when it is readySQS, not SNS
SNS pushes each message to its subscribers as soon as it is published.
replay last week's orders to a new subscriberArchiving and replay on a FIFO topic
A FIFO topic can keep messages for up to 365 days for subscribers to replay.
An online store's checkout service must tell three systems about every order: fulfilment, analytics and a fraud check. Each works at its own pace, a slow or failed system must neither hold up the others nor lose orders, and the fraud system wants only orders above a set value. What should a solutions architect design?
A checkout function must announce each order once, so that a fulfilment queue and several other subscribers each have their own copy pushed to them at the same moment. What does the function publish to?
23 days; email, SMS and push for 6 hours.256 KiB; more through S3 with the Extended Client Library.This whole page is free right now.The AWS library is still being written, so every page of it is open to everyone while that lasts. It becomes a paid bundle later; what you read today costs you nothing.
Every fact on this page was checked against AWS’s own documentation on 15 Sept 2026. If AWS has changed something since, its page is the one to trust.