Amazon SQS

Scaling, Limits & Cost

Know the operational envelope: throughput, message size, retention, and what you pay for.

SQS is fully managed and scales automatically — Standard queues handle effectively unlimited throughput with no provisioning, while FIFO queues have bounded but batch-improvable rates. There is nothing to size or cluster; you pay per request (each API call, with batching counting as one request for up to 10 messages) plus data transfer.

A pay-per-parcel courier: it scales to any volume automatically, but each parcel has a size cap (use a warehouse + ticket for big items), parcels are discarded if unclaimed for two weeks, and shipping ten parcels in one box (batching) is far cheaper than ten separate shipments.

Key Concepts

1
Key limits shape design. Maximum message size is 256 KB; larger payloads use the Extended Client Library to store the body in S3 and pass a pointer (the claim-check pattern). Messages are retained up to 14 days (default 4 days) and discarded after. In-flight (received but not yet deleted) messages are capped (120,000 for Standard, 20,000 for FIFO). DelaySeconds can postpone delivery up to 15 minutes.
2
Cost control is mostly about reducing request count: long polling to avoid empty receives, and batch send/receive/delete (up to 10 messages per call) to cut per-message cost roughly tenfold.
3
What the interviewer is probing.
What the interviewer is probing.
4
1. "How is SQS priced?" *Probing:* the commercial understanding. *Stalls:* "Per message." *Moves up:* per request in batches of up to ten, so batching and long polling are the two main cost levers.
1. "How is SQS priced?"
5
2. "What limits should you know?" *Probing:* the practical detail. *Stalls:* "None." *Moves up:* 256KB message size, 14 days maximum retention, 15 minutes maximum delay, and 120,000 in-flight messages per standard queue.
2. "What limits should you know?"
6
3. "How do you send something larger than 256KB?" *Probing:* the pattern. *Stalls:* "Split it." *Moves up:* the claim-check pattern — store the payload in S3 and send a reference.
3. "How do you send something larger than 256KB?"
7
4. "What drives consumer autoscaling?" *Probing:* the operational angle. *Stalls:* "CPU." *Moves up:* queue depth and message age — age is the better signal, since depth alone does not say whether you are falling behind.
4. "What drives consumer autoscaling?"