Skip to Content

DVA-C02: How to Handle UnprocessedKeys in DynamoDB BatchGetItem Operations

Learn how to use the BatchGetItem low-level API operation to make batch requests to Amazon DynamoDB. Find out why UnprocessedKeys may occur and how to increase the resiliency of your application by using best practices for retrying and scaling.

Table of Contents

Question

A developer has an application that makes batch requests directly to Amazon DynamoDB by using the BatchGetItem low-level API operation. The responses frequently return values in the UnprocessedKeys element.

Which actions should the developer take to increase the resiliency of the application when the batch response includes values in UnprocessedKeys? (Choose two.)

A. Retry the batch operation immediately.
B. Retry the batch operation with exponential backoff and randomized delay.
C. Update the application to use an AWS software development kit (AWS SDK) to make the requests.
D. Increase the provisioned read capacity of the DynamoDB tables that the operation accesses.
E. Increase the provisioned write capacity of the DynamoDB tables that the operation accesses.

Answer

B. Retry the batch operation with exponential backoff and randomized delay.
D. Increase the provisioned read capacity of the DynamoDB tables that the operation accesses.

Explanation

The correct answer to the question is B and D. The developer should retry the batch operation with exponential backoff and randomized delay, and increase the provisioned read capacity of the DynamoDB tables that the operation accesses.

The reason for this answer is that:

  • Option B: Retrying the batch operation with exponential backoff and randomized delay is a recommended strategy for handling throttling errors in DynamoDB. Exponential backoff means increasing the waiting time between retries exponentially, while randomized delay means adding some randomness to avoid multiple requests retrying at the same time. This way, the developer can reduce the likelihood of exceeding the provisioned throughput and avoid wasting resources on failed requests.
  • Option D: Increasing the provisioned read capacity of the DynamoDB tables that the operation accesses is another way to increase the resiliency of the application when the batch response includes values in UnprocessedKeys. Provisioned read capacity is the maximum amount of read operations per second that a table can support. By increasing this value, the developer can allow more concurrent batch requests to succeed without being throttled. However, this option also increases the cost of using DynamoDB, so it should be balanced with the expected demand and performance requirements.

The other options are incorrect because:

  • Option A: Retrying the batch operation immediately is not a good practice for dealing with UnprocessedKeys in DynamoDB. This option does not address the root cause of the problem, which is that the batch request exceeds the provisioned throughput of the table. Retrying immediately will only increase the load on the table and cause more throttling errors.
  • Option C: Updating the application to use an AWS software development kit (AWS SDK) to make the requests is not a necessary action for increasing the resiliency of the application when the batch response includes values in UnprocessedKeys. The AWS SDKs provide convenience methods for making batch requests to DynamoDB, but they do not automatically handle UnprocessedKeys or throttling errors. The developer still needs to implement retry logic and adjust provisioned capacity as needed.
  • Option E: Increasing the provisioned write capacity of the DynamoDB tables that the operation accesses is not a relevant action for increasing the resiliency of the application when the batch response includes values in UnprocessedKeys. Provisioned write capacity is the maximum amount of write operations per second that a table can support. However, the question is about using BatchGetItem, which is a read operation, not a write operation. Therefore, increasing provisioned write capacity will not affect the outcome of BatchGetItem requests.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers