Migrating MongoDB to DynamoDB in AWS

Migrating MongoDB to DynamoDB

Prev Question Next Question

Question

A media company is working on migrating its various on-premises products and services to the AWS platform.

In one web service, MongoDB was used to store user subscription information.

The AWS cloud engineer has migrated this NoSQL database to DynamoDB in AWS.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct AnswerB, D.

DynamoDB can return various exceptions with different error messages and codes.

The reference is in https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html.

Option A is incorrect: Because the AWS SDKs for DynamoDB automatically retry requests that receive this exception.

The request to DynamoDB is eventually successful unless the retry queue is too large to finish.

Option B is CORRECT: Because the CloudWatch metrics can tell the difference between provisioned capacity and consumed capacity.

It helps understand the proper value to the provisioned capacity.

Option C is incorrect: Because there are no ProvisionedThroughputExceededException metrics for the DynamoDB table.

Option D is CORRECT: Because the straightforward way is to increase the provisioned capacity and monitor if it can help resolve the problem.

AS

QIN S

Label
ProvisionedWriteCapacityUnits
ConsumedReadCapacityUnits
ProvisionedReadCapacityUnits

ConsumedWriteCapacityUnits

Sure, I'd be happy to provide a detailed explanation of the answer options for this question:

A. In Java AWS SDK, implement a retry mechanism to retry the request when the exception ProvisionedThroughputExceededException happens.

This answer option suggests implementing a retry mechanism in the Java AWS SDK to handle the ProvisionedThroughputExceededException. This exception occurs when a request exceeds the provisioned throughput limit of a DynamoDB table. By implementing a retry mechanism in the Java AWS SDK, the application can automatically retry the request when this exception occurs. This approach can help to improve the resiliency of the application, but it may not be sufficient to solve the problem entirely. If the request is frequently hitting the provisioned throughput limit, the retry mechanism may be triggered frequently, leading to increased latency and reduced performance. Therefore, this option is only a partial solution to the problem.

B. Open the Amazon CloudWatch console and view performance metrics for provisioned throughput vs. consumed throughput.

This answer option suggests using the Amazon CloudWatch console to monitor the provisioned throughput vs. consumed throughput metrics for the DynamoDB table. This approach can help to identify whether the table is hitting its provisioned throughput limits frequently, and whether additional capacity is needed. If the provisioned throughput limit is consistently being hit, it may be necessary to increase the provisioned capacity of the table to avoid performance issues. By monitoring these metrics, the AWS cloud engineer can identify the need for additional capacity before it becomes a problem.

C. In the CloudWatch console and view the ProvisionedThroughputExceededException metrics to understand when it happens.

This answer option suggests using the CloudWatch console to monitor the ProvisionedThroughputExceededException metrics. This approach can help to identify when the exception occurs and whether it is happening frequently. By monitoring this metric, the AWS cloud engineer can identify the need to increase the provisioned capacity of the DynamoDB table. However, this option only provides visibility into when the exception occurs, and it does not provide a solution to the underlying problem.

D. Increase the provisioned read, write capacity, and monitor the log system.

This answer option suggests increasing the provisioned read and write capacity of the DynamoDB table and monitoring the log system. This approach can help to prevent the ProvisionedThroughputExceededException from occurring by ensuring that the table has sufficient capacity to handle the workload. By monitoring the log system, the AWS cloud engineer can identify whether the capacity increase has been successful in preventing the exception from occurring. This approach is a comprehensive solution to the underlying problem and can ensure that the application performs well in production.

Overall, option D is the best answer because it provides a comprehensive solution to the problem by increasing the provisioned capacity of the DynamoDB table and monitoring the log system. Option B is also a valid answer because it provides visibility into the provisioned throughput vs. consumed throughput metrics, which can help to identify the need for additional capacity. Option A is a partial solution to the problem, and option C only provides visibility into the exception, without providing a solution.