SQS Standard vs FIFO Queues
Compare Standard queues for maximum throughput with FIFO queues for ordered, exactly-once processing, and choose the right type.
SQS Standard vs FIFO Queues is a free AWS Solutions Architect lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Message Queues Matter
Message queues decouple producers from consumers: a producer sends a message to the queue without waiting for a consumer to process it. The consumer processes messages at its own pace. This pattern prevents fast producers from overwhelming slow consumers, enables independent scaling of each tier, and provides a durable buffer if the consumer is temporarily unavailable. Amazon SQS is AWS's fully managed, highly available message queuing service.
SQS Standard Queue Characteristics
Standard queues offer unlimited throughput (nearly unlimited transactions per second). They guarantee at-least-once delivery—a message may be delivered more than once in rare cases (due to distributed infrastructure). Message order is best-effort: messages are generally delivered in the order sent but not guaranteed. Standard queues are ideal when throughput is critical and your consumer can handle occasional duplicates and out-of-order delivery.
# Create a Standard queue
aws sqs create-queue \
--queue-name 'OrderProcessingQueue'
# Send a message
aws sqs send-message \
--queue-url 'https://sqs.us-east-1.amazonaws.com/123456789012/OrderProcessingQueue' \
--message-body 'OrderId-12345'SQS FIFO Queue Characteristics
FIFO queues (First-In, First-Out) guarantee exactly-once processing and strict message ordering. Messages are delivered in the exact order they are sent. FIFO queues support up to 300 transactions per second (3,000 with batching). FIFO queue names must end with .fifo. Use FIFO queues when order and exactly-once semantics are critical—financial transactions, e-commerce order processing, inventory updates.
# Create a FIFO queue
aws sqs create-queue \
--queue-name 'OrderProcessingQueue.fifo' \
--attributes '{
"FifoQueue": "true",
"ContentBasedDeduplication": "true"
}'Message Groups in FIFO Queues
FIFO queues use Message Group IDs to partition ordering within the queue. Messages with the same Group ID are delivered in order; messages with different Group IDs can be processed in parallel. For example, use customerId as the Group ID: each customer's orders are processed in sequence, but different customers' orders are processed concurrently. This enables FIFO semantics with horizontal scalability across consumers.
aws sqs send-message \
--queue-url 'https://sqs.us-east-1.amazonaws.com/123456789012/Orders.fifo' \
--message-body 'Order details here' \
--message-group-id 'customer-789' \
--message-deduplication-id 'order-uuid-abc123'Deduplication in FIFO Queues
FIFO queues prevent duplicate message processing using a deduplication ID. If two messages are sent with the same ID within a 5-minute deduplication interval, the second is silently discarded. You can provide a deduplication ID explicitly (MessageDeduplicationId) or enable content-based deduplication where SQS computes a SHA-256 hash of the message body as the deduplication ID automatically. Content-based deduplication is simpler but requires unique message bodies.
Message Retention and Size Limits
SQS retains messages for a configurable period: minimum 1 minute, maximum 14 days (default 4 days). Messages not consumed within the retention period are automatically deleted. The maximum message size is 256 KB. For larger payloads, use the SQS Extended Client Library or store the payload in S3 and send only the S3 object reference in the SQS message. Both Standard and FIFO queues share these limits.
Receiving and Deleting Messages
Consumers poll the queue using receive-message. After receiving, the message becomes invisible (hidden from other consumers) for the visibility timeout period. The consumer must process the message and then explicitly delete it using the receipt handle before the timeout expires. If the consumer crashes or doesn't delete in time, the message reappears and another consumer can process it—enabling at-least-once delivery in Standard queues.
RECEIPT=$(aws sqs receive-message \
--queue-url 'https://...' \
--query 'Messages[0].ReceiptHandle' --output text)
# Process message, then delete it
aws sqs delete-message \
--queue-url 'https://...' \
--receipt-handle "$RECEIPT"Throughput Comparison in Practice
Standard queues are suitable for: image thumbnail generation, sending notification emails, log processing—workloads where duplicates can be handled idempotently and order doesn't matter. FIFO queues are required for: bank transfer processing (debit before credit), e-commerce cart updates (add item before checkout), workflow steps where step 2 must follow step 1. For most high-throughput architectures, Standard queues are the default choice; switch to FIFO only when ordering or exactly-once delivery is a hard requirement.
Batching for Throughput and Cost
SQS charges per API request. Use batch operations to send, receive, and delete up to 10 messages per API call, reducing costs by up to 10x. FIFO queues support high-throughput mode (enabling batching) which raises the limit to 3,000 messages per second with batching of 10. Always use send-message-batch and delete-message-batch in production to minimise API call costs.
aws sqs send-message-batch \
--queue-url 'https://...' \
--entries '[
{"Id": "msg1", "MessageBody": "Order-001"},
{"Id": "msg2", "MessageBody": "Order-002"},
{"Id": "msg3", "MessageBody": "Order-003"}
]'Queue Access Policies
SQS queues are secured by resource-based policies (queue policies) that control who can send to or receive from the queue. This is critical when allowing cross-account access or when SNS publishes to an SQS queue. Lambda's access to SQS is controlled by the Lambda execution role's IAM policy (sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes). Always apply least-privilege: don't give a consumer more than receive and delete permissions.
Choosing Standard vs FIFO: A Decision Guide
Ask these questions to choose: (1) Does order matter? If yes → FIFO. (2) Is exactly-once processing required? If yes → FIFO. (3) Is throughput above 3,000 TPS needed? If yes → Standard (FIFO caps at 3,000 TPS with batching). (4) Can consumers handle duplicates? If yes → Standard is simpler and cheaper. For the SAA-C03 exam, FIFO keywords are: 'ordering', 'exactly-once', 'sequential', 'deduplication'. Standard keywords are: 'high throughput', 'best effort', 'at-least-once'.
Quick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: Standard queues offer unlimited throughput with at-least-once delivery and best-effort ordering, suitable for high-volume workloads that can tolerate duplicates, FIFO queues guarantee exactly-once processing and strict message ordering using Message Group IDs and deduplication IDs, capped at 3,000 TPS with batching, and choosing between them depends on whether ordering and deduplication are hard requirements. Next up we explore visibility timeout, dead-letter queues, and long polling.
Frequently asked questions
Is the “SQS Standard vs FIFO Queues” lesson free?
Yes — the full text of “SQS Standard vs FIFO Queues” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “SQS Standard vs FIFO Queues”?
Compare Standard queues for maximum throughput with FIFO queues for ordered, exactly-once processing, and choose the right type. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “SQS Standard vs FIFO Queues” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.