Amazon SQS queue types
Amazon SQS supports two types of queues – standard queues and FIFO queues. Use the information from the following table to choose the right queue for your situation. To learn more about Amazon SQS queues, see Amazon SQS standard queues and Amazon SQS FIFO queues.
Standard queues | FIFO queues |
---|---|
Unlimited throughput –
Standard queues support a very high, nearly unlimited number of API calls per second, per action
( At-least-once delivery – Guaranteed at-least-once delivery, meaning that every message is delivered at least once, but in some cases, a message may be delivered more than once due to retries or network delays. You should design your application to handle potential duplicate messages by using idempotent operations, which ensure that processing the same message multiple times will not affect the system’s state. Best-effort ordering – Provides best-effort ordering, meaning that while Amazon SQS attempts to deliver messages in the order they were sent, it does not guarantee this. In some cases, messages may arrive out of order, especially under conditions of high throughput or failure recovery. For applications where the order of message processing is crucial, you should handle reordering logic within the application or use FIFO queues for strict ordering guarantees. Durability and redundancy – Standard queues ensure high durability by storing multiple copies of each message across multiple AWS Availability Zones. This ensures that messages are not lost, even in the event of infrastructure failures. Visibility timeout – Amazon SQS allows you to configure a visibility timeout to control how long a message stays hidden after being received, ensuring that other consumers do not process the message until it has been fully handled or the timeout expires. |
High throughput –
When you use batching, FIFO queues process up to
3,000 messages per second per API method ( Exactly-once processing – FIFO
queues deliver each message once and keep it available until you process
and delete it. By using features like
First-in-first-out delivery – FIFO queues ensure that you receive messages in the order they are sent within each message group. By distributing messages across multiple groups, you can process them in parallel while still maintaining the order within each group. |
|
|
Use standard queues to send data between applications when throughput is
crucial, for example:
|
Use FIFO queues to send data between applications when the order of events is important, for example:
|