Amazon Simple Queue Service (SQS) | FIFO Queues Flashcards

1
Q

Can I delete all messages in a message queue without deleting the message queue itself?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Yes. You can delete all messages in an Amazon SQS message queue using the PurgeQueue action.

When you purge a message queue, all the messages previously sent to the message queue are deleted. Because your message queue and its attributes remain, there is no need to reconfigure the message queue; you can continue using it.

To delete only specific messages, use the DeleteMessage or DeleteMessageBatch actions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the differences between a standard queue and a FIFO queue?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Standard Queues

Unlimited Throughput: Standard queues support a nearly unlimited number of transactions per second (TPS) per API action.

At-Least-Once Delivery: A message is delivered at least once, but occasionally more than one copy of a message is delivered.

Best-Effort Ordering: Occasionally, messages might be delivered in an order different from which they were sent.

FIFO Queues

High Throughput: By default, FIFO queues support up to 300 messages per second (300 send, receive, or delete operations per second). When you batch 10 messages per operation (maximum), FIFO queues can support up to 3,000 messages per second. To request a limit increase, file a support request.

Exactly-Once Processing: A message is delivered once and remains available until a consumer processes and deletes it. Duplicates aren’t introduced into the queue.

First-In-First-Out Delivery: The order in which messages are sent and received is strictly preserved (i.e. First-In-First-Out).

sqs-what-is-sqs-standard-queue-diagram

sqs-what-is-sqs-fifo-queue-diagram

You can use standard message queues in many scenarios, as long as your application can process messages that arrive more than once and out of order, for example:

Decouple live user requests from intensive background work: Let users upload media while resizing or encoding it.

Allocate tasks to multiple worker nodes: Process a high number of credit card validation requests.

Batch messages for future processing: Schedule multiple entries to be added to a database.

FIFO queues are designed to enhance messaging between applications when the order of operations and events is critical, or where duplicates can’t be tolerated, for example:

Ensure that user-entered commands are executed in the right order.

Display the correct product price by sending price modifications in the right order.

Prevent a student from enrolling in a course before registering for an account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What regions are FIFO queues available in?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

FIFO queues are currently available in the US West (Oregon), US East (Ohio), US East (N. Virginia), and EU (Ireland) regions. This feature will be available in more regions in the coming months.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many copies of a message will I receive?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

FIFO queues are designed to never introduce duplicate messages. However, your message producer might introduce duplicates in certain scenarios: for example, if the producer sends a message, does not receive a response, and then resends the same message. Amazon SQS APIs provide deduplication functionality that prevents your message producer from sending duplicates. Any duplicates introduced by the message producer are removed within a 5-minute deduplication interval.

For standard queues, you might occasionally receive a duplicate copy of a message (at-least-once delivery). If you use a standard queue, you must design your applications to be idempotent (that is, they must not be affected adversely when processing the same message more than once).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Are the Amazon SQS queues I used previously changing to FIFO queues?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

No. Amazon SQS standard queues (the new name for existing queues) remain unchanged, and you can still create standard queues. These queues continue to provide the highest scalability and throughput; however, you will not get ordering guarantees and duplicates might occur.

Standard queues are appropriate for many scenarios, such as work distribution with multiple idempotent consumers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can I convert my existing standard queue to a FIFO queue?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

No. You must choose the queue type when you create it. However, it is possible to move to a FIFO queue. For more information, see Moving From a Standard Queue to a FIFO Queue in the Amazon SQS Developer Guide.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Are Amazon SQS FIFO queues backwards-compatible?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

To take advantage of FIFO queue functionality, you must use the latest AWS SDK.

FIFO queues use the same API actions as standard queues, and the mechanics for receiving and deleting messages and changing the visibility timeout are the same. However, when sending messages, you must specify a message group ID. For more information, see FIFO Queue Logic in the Amazon SQS Developer Guide.

Important: You can’t convert an existing standard queue into a FIFO queue. To make the move, you must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see Moving from a Standard Queue to a FIFO Queue in the Amazon SQS Developer Guide.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

With which AWS or external services are Amazon SQS FIFO queues compatible?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Some AWS or external services that send notifications to Amazon SQS might not be compatible with FIFO queues, despite allowing you to set a FIFO queue as a target.

The following features of AWS services aren’t currently compatible with FIFO queues:

Amazon CloudWatch Events

Amazon S3 Event Notifications

Amazon SNS Topic Subscriptions

Auto Scaling Lifecycle Hooks

AWS IoT Rule Actions

AWS Lambda Dead Letter Queues

For information about compatibility of other services with FIFO queues, see your service documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Are Amazon SQS FIFO queues compatible with the Amazon SQS Buffered Asynchronous Client, the Amazon SQS Extended Client Library for Java, or the Amazon SQS Java Message Service (JMS) Client?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

FIFO queues aren’t currently compatible with the Amazon SQS Buffered Asynchronous Client.

FIFO queues are compatible with the Amazon SQS Extended Client Library for Java and the Amazon SQS Java Message Service (JMS) client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which AWS CloudWatch metrics do Amazon SQS FIFO queues support?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

FIFO queues support all metrics that standard queues support. For FIFO queues, all approximate metrics return accurate counts. For example, the following AWS CloudWatch metrics are supported:

ApproximateNumberOfMessagesDelayed - The number of messages in the queue that are delayed and not available for reading immediately.

ApproximateNumberOfMessagesVisible - The number of messages available for retrieval from the queue.

ApproximateNumberOfMessagesNotVisible - The number of messages that are in flight (sent to a client but have not yet been deleted or have not yet reached the end of their visibility window).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are message groups?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Messages are grouped into distinct, ordered “bundles” within a FIFO queue. For each message group ID, all messages are sent and received in strict order. However, messages with different message group ID values might be sent and received out of order. You must associate a message group ID with a message. If you don’t provide a message group ID, the action fails.

If multiple hosts (or different threads on the same host) send messages with the same message group ID are sent to a FIFO queue, Amazon SQS delivers the messages in the order in which they arrive for processing. To ensure that Amazon SQS preserves the order in which messages are sent and received, ensure that multiple senders send each message with a unique message group ID.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Do Amazon SQS FIFO queues support multiple producers?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Yes. One or more producers can send messages to a FIFO queue. Messages are stored in the order that they were successfully received by Amazon SQS.

If multiple producers send messages in parallel, without waiting for the success response from SendMessage or SendMessageBatch actions, the order between producers might not be preserved. The response of SendMessage or SendMessageBatch actions contains the final ordering sequence that FIFO queues use to place messages in the queue, so your multiple-parallel-producer code can determine the final order of messages in the queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Do Amazon SQS FIFO queues support multiple consumers?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

By design, Amazon SQS FIFO queues don’t serve messages from the same message group to more than one consumer at a time. However, if your FIFO queue has multiple message groups, you can take advantage of parallel consumers, allowing Amazon SQS to serve messages from different message groups to different consumers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can I use a dead letter queue with FIFO queues?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Yes. However, you must use a FIFO dead letter queue with a FIFO queue. (Similarly, you can use only a standard dead letter queue with a standard queue.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the throughput limit for an Amazon SQS FIFO queue?

FIFO Queues

Amazon Simple Queue Service (SQS) | Application Integration

A

Without batching, FIFO queues can support up to 300 messages per second (300 SendMessage, ReceiveMessage, or DeleteMessage operations per second). If you take advantage of the maximum batching of 10 messages per operation, FIFO queues can support up to 3,000 messages per second. Amazon SQS standard queues have unlimited throughput.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly