AWS Services / Amazon SQS / SNS
Application Integration

Amazon SQS / SNS

Simple Queue Service / Simple Notification Service

Overview

Amazon SQS and SNS are fully managed messaging services for decoupling components. SQS is a queue that temporarily holds messages so producers and consumers can work independently — buffering peak load and tolerating slow or failed consumers. SNS is a Pub/Sub notification service that simultaneously delivers a single message to multiple subscribers (fan-out). Together they form the backbone of event-driven, fault-tolerant, independently scalable architectures.

Key Concepts

SQS Fundamentals

SQS buffers messages until consumers poll and process them. If processing fails, the message remains in the queue and becomes visible again after the visibility timeout expires — no message loss. Consumers must explicitly delete successfully processed messages. The queue absorbs traffic spikes, letting workers process at their own pace.

Standard vs. FIFO Queues

Standard queues offer very high throughput but may deliver messages out of order and rarely deliver duplicates (at-least-once delivery) — design consumers to be idempotent. FIFO queues guarantee ordering and exactly-once processing with deduplication, but have lower throughput limits. Choose based on ordering and deduplication requirements.

SNS Fan-Out

A single SNS topic message is delivered simultaneously to all subscribed endpoints — SQS queues, Lambda, HTTP/S, email, or SMS. The SNS → multiple SQS fan-out pattern ensures every processing system reliably receives the event while scaling and retrying independently.

Dead-Letter Queue (DLQ)

Messages that fail processing after a configured number of retries are moved to a dead-letter queue. Prevents a poisoned message from blocking the main queue indefinitely, and enables later investigation and reprocessing. Essential for reliable message processing pipelines.

Loose Coupling and Right Tool

SQS is for buffering job queues where workers pull at their own pace. SNS is for Pub/Sub fan-out. Kinesis suits ordered, high-volume stream aggregation. Synchronous HTTP ties caller and callee tightly — decoupling with SQS/SNS improves scalability and fault tolerance.

Typical Use Cases

  • Decouple web requests from heavy downstream processing with SQS, buffering traffic spikes
  • Fan out one event to multiple processing systems with SNS → multiple SQS queues
  • Implement order processing with guaranteed order and deduplication using FIFO queues
  • Isolate failed messages in a DLQ for investigation and later reprocessing
  • Send system alerts simultaneously to email, SMS, Lambda, and other channels via SNS

Exam Relevance

SQS/SNS are central to application integration in SAA and DVA. 'Decouple components,' 'buffer against traffic spikes,' 'no message loss' → SQS is almost always the right answer. 'One event to multiple systems simultaneously' → SNS fan-out; 'reliably deliver to each system + independent scaling' → SNS + SQS fan-out pattern. Standard (high throughput, at-least-once, unordered) vs. FIFO (exactly-once, ordered, lower throughput), visibility timeout, and DLQ are DVA staples. Kinesis (ordered stream aggregation) vs. SQS (job queue) is also tested.

Related Services

Last updated: 2026-06-24

This page is created from AWS official documentation and reviewed/edited by the operator. See our editorial & quality policy for details.