Q72 — AWS SAA-C03 Ch.13

Question 72 of 100 | ← Chapter 13

Q972. A company hosts its order processing system on AWS. The architecture consists of a frontend and a backend.The frontend includes an Application Load Balancer (ALB) and Amazon EC2 instances in an Auto-Scaling group.The backend includes an EC2 instance and an Amazon RDS MySQL database.To prevent incomplete or lost orders,the company wants to ensure that order states are always preserved.The company wants to ensure that every order will eventually be processed,even after an outage or pause.Every order must be processed exactly once.Which solution will meet these requirements?

Correct Answer: C. Create an Auto Scaling group for the backend. Configure the backend EC2 instances to consume messages from an Amazon Simple Queue Service(Amazon SQS) FlFO queue.Configure a dead-letter queue (DLQ) for the SQS queue.

Explanation

The correct answer is:C. Create an Auto Scaling group for the backend. Configure the backend EC2 instances to consume messages from an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Configure a dead-letter queue (DLQ) for the SQS queue.Explanation:A. Create an Auto Scaling group and an ALB for the backend. Create a read replica for the RDS database in a second Availability Zone. Update the backend RDS endpoint.- This solution does not meet the requirement of ensuring that every order is processed exactly once. The read replica may not receive updates immediately, and orders could be processed more than once.B. Create an Auto Scaling group and an ALB for the backend. Create an Amazon RDS proxy in front of the RDS database. Update the backend EC2 instance to use the Amazon RDS proxy endpoint.- This solution also does not meet the requirement of ensuring that every order is processed exactly once.The RDS proxy does not guarantee exactly-once processing.C. Create an Auto Scaling group for the backend. Configure the backend EC2 instances to consume messages from an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Configure a dead-letter queue (DLQ) for the SQS queue.- This is the correct solution. By using an SQS FIFO queue, you can ensure that every order is processed exactly once. The dead-letter queue will capture any orders that failed to be processed, allowing you to investigate and reprocess them.D. Create an AWS Lambda function to replace the backend EC2 instance. Subscribe the function to an Amazon Simple Notification Service (Amazon SNS) topic. Configure the frontend to send orders to the SNS topic.- This solution does not meet the requirement of ensuring that every order is processed exactly once. The SNS topic does not guarantee exactly-once delivery, and the Lambda function could be invoked more than once for the same order.In summary, the correct solution is option C, which uses an SQS FIFO queue and a dead-letter queue to ensure that every order is processed exactly once and that no orders are lost.