ENES

Amazon SQS

A waiting line for messages between programs, so none of them gets lost.

A producer dropping messages into a queue and a consumer picking them up one at a time

Amazon SQS (Simple Queue Service) is a managed message queue. One program (the producer) drops messages into the queue; another (the consumer) picks them up when it is ready. The two never talk directly and do not even need to be running at the same time.

It solves a common problem: one part of a system is faster than another. An online shop takes 5,000 orders in a minute during a sale, but the service that prints shipping labels handles 50 per minute. With a queue in the middle, orders wait in line instead of failing, and the label printer works through them at its own pace.

SQS keeps each message until a consumer deletes it. If the consumer crashes halfway, the message becomes visible again after a timeout and another consumer retries it. Messages that fail too many times are moved to a dead-letter queue for a human to inspect. It pairs naturally with AWS Lambda: a function can be triggered for every batch of messages that arrives.

There are two kinds: standard queues (very high throughput, order mostly preserved, a message may rarely be delivered twice) and FIFO queues (strict order, no duplicates, lower throughput).

Keep in mind

Go deeper

Related terms

More in AWS