SQS Standard vs FIFO
- Standard: best-effort ordering, at-least-once delivery, unlimited throughput.
- FIFO: strict ordering within message groups, exactly-once processing, 300 TPS (3,000 with batching).
- FIFO queue names must end with ".fifo".
- MessageGroupId groups related messages; MessageDeduplicationId prevents duplicates within 5 minutes.
SQS Configuration
- Visibility timeout: 0 to 12 hours (default 30 seconds). If processing takes longer, message reappears.
- Message retention: 1 minute to 14 days (default 4 days). Max message size: 256 KB.
- Long polling (WaitTimeSeconds > 0): reduces empty responses and API calls. Max 20 seconds.
- Dead-letter queue (DLQ): receives messages that fail processing after maxReceiveCount attempts.
- Delay queues: postpone delivery of new messages (0 to 15 minutes).
SNS Topics & Subscriptions
- Standard topic: best-effort ordering, at-least-once delivery. Up to 12.5 million subscriptions.
- FIFO topic: strict ordering, exactly-once delivery. Only SQS FIFO queue subscriptions.
- Subscription protocols: SQS, Lambda, HTTP/S, email, SMS, Kinesis Data Firehose.
- Message filtering: subscription filter policies reduce unnecessary message delivery.
Fan-Out Pattern
- SNS + SQS fan-out: SNS topic pushes to multiple SQS queues for parallel processing.
- Ensures each downstream service gets its own copy of the message independently.
- Combine with SQS FIFO for ordered fan-out to multiple consumers.
- Alternative: EventBridge for complex routing rules and many targets.
Practice Amazon SQS & Amazon SNS Questions
Put your knowledge to the test with practice questions.