SQS vs SNS vs Kinesis
How the queue, pub/sub and streaming models compare, and how to pick between SQS, SNS and Kinesis on the exam.
The three models
Amazon SQS
- Consumers pull data.
- Data is deleted after being consumed.
- As many workers (consumers) as needed; each message goes to one of them.
- No need to provision throughput.
- Ordering guaranteed only with FIFO queues.
- Individual message delay is possible.
Amazon SNS
- Pushes data to many subscribers (up to 12,500,000 per topic).
- Data is not persisted: lost if not delivered.
- Pub/sub, up to 100,000 topics.
- No need to provision throughput.
- Integrates with SQS for the fan-out pattern.
- FIFO topics for ordering, with SQS FIFO.
Amazon Kinesis Data Streams
- Standard: consumers pull data, 2 MB/s per shard shared.
- Enhanced fan-out: data is pushed, 2 MB/s per shard per consumer.
- Data can be replayed.
- Built for real-time big data, analytics and ETL.
- Ordering at the shard level.
- Data expires after a set number of days (1 to 365).
- Provisioned or on-demand capacity.
How to choose
- One message, one worker, at its own pace → SQS.
- One message, many different receivers → SNS (with SQS queues behind it if they must not miss anything).
- A continuous stream that several consumers read, maybe again later → Kinesis Data Streams.
Exam tips
- "Decouple and buffer work" → SQS. "Notify many systems" → SNS. "Real-time analytics on a stream" → Kinesis.
- "Replay messages from yesterday" → Kinesis (or an SNS FIFO topic archive, or EventBridge archive); SQS deletes processed messages.
- "Several consumers each need every record" → SNS fan-out or Kinesis, not one SQS queue.
- "No capacity planning at all" → SQS or SNS (or Kinesis on-demand).
Common traps
- "SQS for broadcasting to several services." Each SQS message is processed by one consumer; use SNS fan-out.
- "SNS for durable buffering." SNS doesn't store messages.
- "Kinesis needs no capacity decisions in provisioned mode." The customer chooses and scales the shards.
Check yourself
Kinesis Data Streams: many consumers can read the same records, and retention (up to 365 days) allows replay.
SNS topic with SQS queues subscribed for each service (fan-out): every service gets its own copy, kept in its queue until it's back.
An SQS queue with an Auto Scaling group of workers scaling on the queue length.
AWS documentation
Kinesis and Data Firehose
Kinesis Data Streams for real-time streaming, its shards and capacity modes, Amazon Data Firehose for loading streams into S3, Redshift and more, and how the two differ.
Amazon MQ
Amazon MQ as managed ActiveMQ and RabbitMQ for applications that use open messaging protocols, its limits, and its high availability setup.