SQS vs SNS

Queue-based point-to-point messaging versus topic-based fan-out delivery.

Overview

What is being compared

SQS and SNS are both AWS messaging services, but they solve different problems and are often used together. SQS (Simple Queue Service) holds messages until one consumer takes each one. SNS (Simple Notification Service) pushes each message to every subscriber. The table sets the two side by side.

  • Model — Distributed message queue — Pub/sub notifications
  • Who gets a message — A single consumer — Every subscriber, at the same time
  • Fits — Work queues, buffering between services, retry and dead-letter patterns — Broadcasting events to many systems; email, SMS, HTTP, Lambda and SQS targets
  • Used together — As the per-consumer queue in fan-out — As the distributor in fan-out

The last row is the one to remember. In fan-out, SNS hands one event to many queues, and each SQS queue holds its copy for one consumer.

Sign up free to read the full topic

More Comparisons topics

Start free on Cariara · Coding problems · System design studio