1.SQS Queues, Visibility Timeout, Long Polling, Standard vs FIFO
An SQS queue holds messages until a consumer processes and deletes them. When a consumer receives a message, it stays in the queue but becomes invisible for the visibility timeout — if the consumer does not delete it in time, it reappears for another consumer. Long polling waits up to 20 seconds for a message instead of returning empty immediately, cutting wasted API calls. A standard queue has unlimited throughput but only best-effort ordering; a FIFO queue guarantees strict order within a message group, at a much lower throughput ceiling.
Key features
- Visibility timeout: default 30 seconds, adjustable per-queue or per-message via ChangeMessageVisibility, hard ceiling 12 hours from first receive
- A message not deleted before the visibility timeout expires becomes visible again and can be received by any consumer — this is the retry mechanism
- Long polling (WaitTimeSeconds > 0, max 20s) queries all servers and waits for a message; short polling (the default, WaitTimeSeconds = 0) samples a subset and returns immediately even if empty
- Standard queue: nearly unlimited throughput, at-least-once delivery, best-effort ordering (messages can arrive out of order or more than once)
- FIFO queue: strict ordering within a MessageGroupId, 300 TPS per API action by default (3,000 msg/sec with batching) — MessageGroupId is required on every message
- FIFO deduplication: a 5-minute window (default) rejects a repeat of the same MessageDeduplicationId or, with content-based deduplication enabled, the same message body hash
- Standard
- Nearly unlimited throughput per API action
- Best-effort ordering — messages can arrive out of order
- At-least-once delivery — duplicates are possible
- FIFO
- 300 TPS per API action by default (3,000 msg/sec batched)
- Strict order guaranteed within a MessageGroupId
- Deduplication window (default 5 min) prevents duplicate sends
Signature
Visibility timeout (30s default, 12h max) · Long polling (WaitTimeSeconds up to 20s) · Standard (unlimited, best-effort order) vs FIFO (300 TPS default, strict order per group)
Visibility timeout hides a received message so only one consumer works it; it reappears if not deleted in time — size it to the job. Long polling (up to 20s) avoids wasted empty responses. Standard = unlimited throughput, best-effort order; FIFO = strict order per MessageGroupId, ~300 TPS default ceiling, dedup window prevents repeat sends.