Amazon SQS

Amazon Simple Queue Service (SQS) is a serverless message queuing service from Amazon Web Services used to decouple (loosely couple) distributed applications, microservices, and serverless components, storing message data until an application is able to process it.

Key points

  • The queue represents a temporary repository between the producer (the component responsible for sending messages to the queue) and the consumer of messages.
  • Standard queues support a very high, nearly unlimited number of API calls per second — the older “1–10,000 messages per second” figure is not correct; there is no hard ceiling like that on standard queue throughput.
  • Default message retention period is four days (minimum 1 minute), extendable up to fourteen days maximum.
  • Messages are automatically deleted after being consumed by consumers.
  • Maximum message size is 1 MiB (1,048,576 bytes) — AWS raised this from the long-standing 256 KiB limit in August 2025; larger payloads still require the Amazon SQS Extended Client Library, which references a payload of up to 2 GB stored in Amazon S3.
  • Two SQS queue types:
    • Standard Queue — nearly unlimited throughput; messages get delivered in any order; a message can be sent twice or multiple times (at-least-once delivery).
    • FIFO Queue — by default, 300 transactions per second per API action (SendMessage/ReceiveMessage/DeleteMessage), or up to 3,000 messages per second when batching 10 messages per call; messages get consumed only once (exactly-once processing).
      • High throughput mode for FIFO raises this substantially — up to 70,000 non-batched transactions per second (and correspondingly more with batching) in US East (N. Virginia), US West (Oregon), and Europe (Ireland), with lower regional ceilings elsewhere; it’s an opt-in setting, not the default.
  • Dead-Letter Queue — a queue for messages that are not consumed successfully after the configured maximum number of attempts, letting a developer review the message to determine the cause of failure.
  • Delay Queue — allows postponing/delaying delivery of messages to a queue for a specific number of seconds; messages can be delayed for 0 seconds (default) up to 15 minutes (maximum).
  • Visibility Timeout — the amount of time during which SQS prevents other consumers from receiving (polling) and processing a message that was already retrieved.
    • Default visibility timeout — 30 seconds.
    • Minimum visibility timeout — 0 seconds.
    • Maximum visibility timeout — 12 hours.
  • Short polling vs long polling — short polling (the default) queries only a subset of SQS servers and returns an immediate response, even if the result is empty; long polling waits up to WaitTimeSeconds (configurable, maximum 20 seconds) for a message to arrive before returning, reducing empty responses and the cost of excessive API calls.
  • Message flow: Simple Queue Service → poll messages → message → process message → consumer → delete message → back to Simple Queue Service.
  • Distinct from Amazon SNS: SQS is a pull-based queue holding messages for one or more consumers to process at their own pace, whereas SNS pushes each message to every subscriber immediately with no storage (fan-out).

Sources