Q24 — AWS SAA-C03 Ch.12

Question 24 of 100 | ← Chapter 12

Q824. A solutions architect is designing a payment processing application that runs on AWS Lambda in private subnets across multiple Availability Zones. The application uses multiple Lambda functions and processes millions of transactions each day.The architecture must ensure that the application does not process duplicate payments.Which solution will meet these requirements?

Correct Answer: C. Use Lambda to retrieve all due payments. Publish the due payments to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Configure another Lambda function to poll the FIFO queue and to process the due payments.

Explanation

The solution that will meet the requirements is option C: Use Lambda to retrieve all due payments. Publish the due payments to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Configure another Lambda function to poll the FIFO queue and process the due payments.By using an Amazon SQS FIFO queue, you can ensure that the messages (due payments) are processed in the order they are received. The FIFO (First-In-First-Out) queue guarantees the order of message processing, which is important for preventing duplicate payments.The initial Lambda function retrieves the due payments, and then publishes them to the SQS FIFO queue. The second Lambda function is configured to poll the FIFO queue and process the due payments. The second Lambda function can process the payments, update the necessary records, and perform any required actions.Option A suggests using an Amazon S3 bucket with event notifications to invoke another Lambda function. While this approach can work, it doesn't provide the same level of ordering guarantee as an SQS FIFO queue. The ordering of events in an S3 bucket is not guaranteed, which could potentially result in processing duplicate payments.Option B suggests using an Amazon SQS standard queue. While SQS standard queues are reliable and scalable, they do not offer the strict ordering guarantee provided by SQS FIFO queues. Using a standard queue could potentially result in out-of-order processing, which may lead to duplicate payments being processed.Option D suggests storing the due payments in an Amazon DynamoDB table and configuring streams to invoke another Lambda function. While DynamoDB streams can be used for capturing and reacting to changes in a table, they do not provide the same level of ordering guarantee as an SQS FIFO queue. Processing duplicate payments could be possible if using streams without additional logic to prevent duplicates.Therefore, option C is the most appropriate solution as it uses an SQS FIFO queue to ensure the order of processing and prevent duplicate payments in the payment processing application running on AWS Lambda.