Learn how to increase the resiliency of your application when using the BatchGetItem low-level API operation in Amazon DynamoDB. Discover the best practices for retrying the batch operation and adjusting the provisioned capacity of your tables.
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.
To create an AWS CloudFormation template to deploy Amazon EC2 instances across multiple AWS accounts, the developer can use parameters to customize the template. Parameters enable you to input custom values to your template each time you create or update a stack. You can use parameters to specify the EC2 instance type for the stack to use when you create or update the stack.
To incorporate the list of approved EC2 instance types in the CloudFormation template, the developer can follow these steps:
- In the Parameters section of the CloudFormation template, create a parameter named InstanceTypeParameter. This parameter lets you specify the EC2 instance type for the stack to use when you create or update the stack.
- Assign a parameter type of String to the parameter. This indicates that the parameter value must be a string.
- Assign a default value of t2.micro to the parameter. This is the value that AWS CloudFormation uses to provision the stack unless another value is provided.
- Assign a list of EC2 instance types as AllowedValues to the parameter. This restricts the parameter value to one of the values in the list. The list should include only the approved EC2 instance types, such as t2.micro, m1.small, and m1.large.
- Assign a description to the parameter. This provides information about the parameter and its usage.
The following example shows how to create a parameter with the list of EC2 instance types as AllowedValues in JSON and YAML syntax:
JSON
"Parameters" : {
"InstanceTypeParameter" : {
"Type" : "String",
"Default" : "t2.micro",
"AllowedValues" : [ "t2.micro", "m1.small", "m1.large" ],
"Description" : "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
}
}
YAML
Parameters:
InstanceTypeParameter:
Type: String
Default: t2.micro
AllowedValues:
- t2.micro
- m1.small
- m1.large
Description: Enter t2.micro, m1.small, or m1.large. Default is t2.micro.
This solution will meet the requirements because:
- It will allow the developer to choose the EC2 instance type from a list of approved instance types in the CloudFormation template.
- It will provide a default value and a description for the parameter to simplify its usage.
- It will validate the parameter value and prevent invalid or unauthorized values from being entered.
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.
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 API calls to AWS services, but they do not automatically handle UnprocessedKeys or retry logic. The developer still has to implement these features in their application code.
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, BatchGetItem is a read operation, not a write operation, so it does not consume write capacity units.
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.