Choosing Between Standard and FIFO Queues
This lesson explains how to choose between the two Amazon SQS queue types, which trade throughput against ordering and delivery guarantees.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish standard and FIFO queues by throughput, ordering and duplicate delivery.
- Explain how message group IDs and deduplication IDs control ordering and remove duplicates.
- Describe the message size limit and how larger payloads are handled.
- Explain how message attributes and batching are used.
Comparing the queue types
Amazon SQS offers two queue types, and the choice is made when the queue is created.
A standard queue supports a nearly unlimited number of requests per second. To achieve this, it stores copies of each message on several servers, and occasionally a message is delivered more than once or out of order. Consumers of a standard queue must therefore be idempotent and must not depend on order. Most decoupling and buffering workloads tolerate this.
A FIFO queue preserves order and removes duplicates. Every message carries a message group ID, and messages with the same group ID are delivered strictly in the order they were sent, one batch at a time; messages in different groups are processed in parallel. Using the customer or order ID as the group ID therefore keeps each customer's events in order while still allowing concurrency. A deduplication ID, or content-based deduplication, discards a repeated message sent within five minutes. FIFO queues have lower throughput limits, which high-throughput mode raises, and their names must end in .fifo. The following table summarises the differences.
.fifoConsumers of a standard queue must be idempotent, because duplicates can occur.
Standard or FIFO?
Message groups and deduplication
SQS FIFO queues preserve order and remove duplicates through two message attributes. The following list describes them.
- Message group ID: order is kept within a group, and different groups are processed in parallel. One group per customer gives both ordering and throughput; a single group for the whole queue serialises everything.
- Deduplication: duplicates are removed within a 5-minute window, using a
MessageDeduplicationIdor content-based deduplication.
Example. Ordering per customer, with a deduplication ID:
sqs.send_message(
QueueUrl="https://sqs.eu-west-1.amazonaws.com/111122223333/orders.fifo",
MessageBody=json.dumps({"orderId": "9017", "event": "PAID"}),
MessageGroupId="customer-42",
MessageDeduplicationId="9017-PAID",
)The following diagram shows how message groups and deduplication behave in the example above.

Message size, attributes and batching
SQS imposes limits on message size and provides attributes and batching. The following list describes these features.
- Size: the maximum was 256 KB for many years, the figure most exam questions use; AWS raised it to 1 MiB in 2025. For larger payloads, the SQS Extended Client Library stores the body in S3 and sends a pointer.
- Message attributes: typed metadata used for routing or filtering.
- Batching:
SendMessageBatch,DeleteMessageBatchandChangeMessageVisibilityBatchhandle up to 10 messages per call, reducing cost.
Tune a queue
Ordering where it matters
A bank's account events (deposit, withdrawal) must be processed in order for each account, but accounts are independent. It processes 5,000 events per second.
| Design | Outcome |
|---|---|
| Standard queue | High throughput but no ordering: a withdrawal could be processed before the deposit that funds it |
| FIFO queue with one message group | Strict global order, but only one consumer can work at a time: too slow |
FIFO queue with MessageGroupId = accountId and high throughput mode | Order per account, parallel processing across accounts |
The third design gives exactly the ordering the business needs and no more. A deduplication ID (the event ID) means a retried send within five minutes does not create a duplicate event.
Order events must be processed in order for each customer, while different customers are processed in parallel. How?
Show answer
Use a FIFO queue with the customer ID as the message group ID. Order is kept within each group, and different groups are processed at the same time.
Exam Tips
Remember for the exam
- When order is required per customer or order, use a FIFO queue with that key as the message group ID.
- Consumers of a standard queue must handle duplicate messages.
- If FIFO throughput is limited because every message shares one group ID, use more group IDs.
- To reduce SQS API cost, batch sends, receives and deletes (up to 10 messages per call).
- Messages larger than the size limit call for the Extended Client Library with S3.