DVA-C02 exam dumps

DVA-C02 practice question 15 of 399

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

DVA-C02 Question 15

Single answer

You are developing an e-commerce application that uses AWS Lambda and Amazon API Gateway. A 'PlaceOrder' API allows users to submit their orders. To prevent duplicate order submissions due to retries caused by network issues, you decide to implement idempotency. How can you achieve this effectively?

  1. A

    Use a unique client-generated idempotency token for each order request and store it in a database along with the order details.

  2. B

    Enable caching in API Gateway to automatically deduplicate requests with the same payload.

  3. C

    Implement retries with exponential backoff in the client-side code to handle network issues without the need for idempotency.

  4. D

    Configure AWS Lambda to reject duplicate requests by default using its built-in idempotency feature.

Show answer and explanation

Correct answer: A

Explanation

Idempotency ensures that multiple identical requests have the same effect as a single request. In this scenario, using a client-generated idempotency token stored in a database allows the backend to check and reject duplicate requests. Other options, such as caching in API Gateway or client-side retries, do not directly solve the idempotency problem, and AWS Lambda does not provide a built-in idempotency feature.

  • A. Correct.

    Correct: Using a client-generated idempotency token, such as a UUID, ensures that even if the same request is submitted multiple times, it can be identified and processed only once by checking the token in a database.

  • B. Incorrect.

    Incorrect: While API Gateway caching can improve performance, it is not designed to handle idempotency for dynamic, user-specific operations like placing an order.

  • C. Incorrect.

    Incorrect: Implementing retries with exponential backoff on the client side is good for handling transient network issues but does not address the issue of duplicate request processing on the backend.

  • D. Incorrect.

    Incorrect: AWS Lambda does not have a built-in idempotency feature for rejecting duplicate requests. Idempotency needs to be handled explicitly in the application logic.

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