An application is currently accessing a DynamoDB table.
Currently, the table queries are performing well.
Changes have been made to the application, and now the performance of the application is starting to degrade.
After looking at the changes, you see that the queries use an attribute that is not the partition key.
Which of the following would be the adequate change to make to resolve the issue?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - A.
The AWS Documentation mentions the following.
Amazon DynamoDB provides fast access to items in a table by specifying primary key values.
However, many applications might benefit from having one or more secondary (or alternate) keys available to allow efficient access to data with attributes other than the primary key.
You can create one or more secondary indexes on a table and issue Query or Scan requests against these indexes to address this.
A secondary index is a data structure that contains a subset of attributes from a table, along with an alternate key to support Query operations.
You can retrieve data from the index using a Query, in much the same way as you use Query with a table.
A table can have multiple secondary indexes, which gives your applications access to many different query patterns.
Option B, although possible, is not the ideal approach to change the application code.
Option C is used for disaster recovery scenarios.
Option D is not right because we don't know if this would solve the issue in the long run.
For more information on Secondary Indexes, please refer to the below URL-
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.htmlThe issue is that the application queries are using an attribute that is not the partition key, which is causing the performance of the application to degrade. To resolve this issue, one of the following changes should be made:
A. Add a Global Secondary Index (GSI) to the DynamoDB table.
B. Change all the queries to ensure they use the partition key.
C. Enable global tables for DynamoDB.
D. Change the read capacity on the table.
In conclusion, adding a Global Secondary Index to the DynamoDB table is the adequate change to make to resolve the issue.