DVA-C02 exam dumps

DVA-C02 practice question 14 of 399

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

DVA-C02 Question 14

Select 3

You are developing a serverless application on AWS that processes orders and stores them in DynamoDB. To ensure that duplicate orders are not processed in the event of retries or failures, you decide to use idempotency. Which of the following approaches will help you achieve idempotency in your application?

  1. A

    Include a unique order ID as the primary key in the DynamoDB table and ensure each order has a unique ID.

  2. B

    Implement a retry mechanism with exponential backoff to handle duplicate request scenarios.

  3. C

    Use an AWS SDK feature like 'clientToken' to pass a unique identifier with each request.

  4. D

    Enable DynamoDB Streams to detect duplicate entries and remove any duplicates.

  5. E

    Store a hash of the order data in DynamoDB and check for existence before processing the order.

Show answer and explanation

Correct answers: A, C, E

Explanation

Idempotency ensures that an operation can be performed multiple times without changing the result beyond the initial application. To achieve idempotency in an AWS application, using unique identifiers for requests (e.g., order IDs or client tokens) and checking for duplicates (e.g., using DynamoDB with a hash of the data) are effective strategies. Retry mechanisms or features like DynamoDB Streams may be helpful in other contexts but do not directly enforce idempotency.

  • A. Correct.

    Including a unique order ID as the primary key in the DynamoDB table ensures that each order is uniquely identifiable, preventing duplicate entries. This is a key practice for implementing idempotency.

  • B. Incorrect.

    While a retry mechanism with exponential backoff helps with handling transient failures, it does not inherently address the problem of duplicate requests and does not enforce idempotency.

  • C. Correct.

    Using a unique identifier like 'clientToken' with each request ensures that the request can be uniquely identified, allowing for retries without processing duplicates.

  • D. Incorrect.

    Enabling DynamoDB Streams is helpful for event-driven architectures but does not inherently prevent or detect duplicate records in the table.

  • E. Correct.

    Storing a hash of the order data allows you to compare incoming requests with existing records in the table to determine if it is a duplicate, thereby enforcing idempotency.

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