Messaging Systems for Order and Duplicate-Free Processing | AWS Certified Developer - Associate Exam

Messaging Systems for Order and Duplicate-Free Processing

Prev Question Next Question

Question

An application needs to make use of a messaging system.

The messages need to be processed in the order they are received, and also no duplicates should be allowed.

Which of the following would you use for this purpose?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - D.

This is also mentioned in the AWS Documentation.

FIFO (First-In-First-Out) 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.

Options A and B are incorrect since an existing Standard queue can't be changed to FIFO.

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

No.

You must choose the queue type when you create it.

However, it is possible to move to a FIFO queue.

Option C is incorrect since this is a notification service and not a queuing service.

For more information on SQS FIFO Queues, please refer to the below URL-

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html

The correct answer is D. Use the FIFO SQS Queues.

Explanation:

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS offers two types of queues, Standard and FIFO.

Standard queues offer a best-effort ordering, which means that messages are delivered in the order in which they are sent but there is a possibility that they may be delivered out of order. Additionally, Standard queues do not guarantee that messages are processed only once, and may deliver duplicate messages.

FIFO (First-In-First-Out) queues guarantee that messages are processed exactly once, and in the order in which they are sent. FIFO queues also prevent duplicates, which means that a message is delivered only once and remains available until a consumer processes and deletes it. FIFO queues are designed to provide the exact order and exactly once processing that is required for many applications.

Therefore, for an application that requires message processing in order and no duplicates, the correct option is to use FIFO SQS queues. Option A is incorrect because enabling FIFO on an existing Standard Queue does not make it a FIFO queue, and it would still have the limitations of Standard queues. Option B is also incorrect because adding the .fifo extension to an existing Standard queue does not make it a FIFO queue, and it may not be compatible with the features of a true FIFO queue. Option C, SNS (Simple Notification Service), is not a message queuing service but rather a publish-subscribe messaging service, which may not be suitable for an application that requires guaranteed order and no duplicates.