SQS: reliable message queuing
SQS (Simple Queue Service) is a managed message queue. A producer sends messages to the queue; a consumer polls the queue, processes messages, and deletes them. The queue buffers messages so the producer and consumer operate independently. If the consumer is slow or temporarily offline, messages wait in the queue rather than being lost.
Standard queues offer best-effort ordering and at-least-once delivery. A message may occasionally be delivered more than once, so consumers should be designed to handle duplicate processing (idempotent). FIFO queues guarantee exactly-once processing and strict first-in-first-out ordering, at the cost of lower throughput (300 messages per second without batching, 3000 with batching).
Visibility timeout is the period after a consumer receives a message during which the message is hidden from other consumers. If the consumer processes it successfully and deletes it before the timeout expires, it is gone. If the consumer fails and does not delete it, the message becomes visible again for another consumer to process. Dead letter queues (DLQ) capture messages that fail processing repeatedly. After a message is received more than the maxReceiveCount threshold, SQS moves it to the DLQ for investigation.
SNS, EventBridge, and Kinesis
SNS (Simple Notification Service) is a pub/sub messaging service. Publishers send a message to a topic. All subscribers to that topic receive the message. Subscribers can be SQS queues, Lambda functions, HTTP/HTTPS endpoints, email addresses, or mobile push notification services. The fan-out pattern combines SNS and SQS: SNS delivers one message to multiple SQS queues in parallel, so multiple independent consumers each process their own copy of the message without competing.
EventBridge routes events from AWS services, SaaS applications, and custom sources to targets based on rules. Where SQS holds messages until a consumer retrieves them and SNS pushes immediately to all subscribers, EventBridge adds filtering: rules match specific event patterns and route only matching events. EventBridge Pipes connects event sources to targets directly with optional filtering and transformation, reducing the need for glue Lambda functions.
Kinesis Data Streams handles high-volume real-time data streaming. Where SQS deletes messages after consumption, Kinesis retains records for up to 365 days and allows multiple consumers to read the same records independently at their own pace. A stream is divided into shards; each shard handles 1 MB/s of writes and 2 MB/s of reads. Kinesis Data Firehose is the managed delivery service: it loads streaming data into S3, Redshift, OpenSearch, or Splunk without requiring you to manage consumers or shards.
How to choose the correct answer
SQS Standard: high throughput, at-least-once, best-effort ordering. Use when duplicates are acceptable.
SQS FIFO: exactly-once processing, strict ordering, lower throughput. Use for financial transactions, order processing.
SNS: push to multiple subscribers simultaneously. Use for notifications and fan-out to multiple SQS queues.
Fan-out pattern: SNS topic with multiple SQS queue subscriptions. Each queue gets a copy for independent processing.
EventBridge: event-driven routing with pattern matching. Use when different consumers need different subsets of events.
Kinesis Data Streams: real-time streaming, multiple independent consumers, data retention up to 365 days.
Kinesis Firehose: managed delivery of streaming data to S3, Redshift, OpenSearch. No consumer management needed.
SQS vs Kinesis: SQS for job queuing where each message is processed once. Kinesis for streaming where multiple consumers read the same data.