DVA-C02 exam dumps

DVA-C02 practice question 13 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 13

Single answer

You are developing an application that processes customer orders. Each order creates a new record in an Amazon DynamoDB table and triggers a payment transaction through an API. To ensure that duplicate charges are not made in case of network retries or timeouts, what is the best way to implement idempotency in the payment transaction API?

  1. A

    Include a unique client-generated idempotency token in the API request and ensure the server uses it to detect duplicate requests.

  2. B

    Enable DynamoDB's conditional writes to ensure that duplicate entries cannot be written to the table.

  3. C

    Use the AWS SDK's Retry Logic feature to handle retries automatically.

  4. D

    Use a timestamp in the API request to uniquely identify each transaction.

Show answer and explanation

Correct answer: A

Explanation

Idempotency ensures that duplicate requests do not result in duplicate actions. Using a unique client-generated idempotency token in the API request allows the server to identify and reject duplicate requests effectively, preventing duplicate charges in payment transactions. This approach is widely used in payment systems to maintain consistency and correctness.

  • A. Correct.

    Correct. Including a client-generated idempotency token ensures that the server can detect duplicate requests and process each unique transaction only once, even during retries.

  • B. Incorrect.

    Incorrect. While conditional writes in DynamoDB prevent duplicate entries in the table, they do not prevent duplicate charges in the payment transaction API.

  • C. Incorrect.

    Incorrect. Retry logic in the AWS SDK handles retries but does not guarantee idempotency, as it does not prevent duplicate charges in case of retries.

  • D. Incorrect.

    Incorrect. A timestamp alone is not a reliable method for ensuring idempotency, as it does not prevent duplicates if two requests happen at the same time with the same value.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam