AWS Certified Database – Specialty — Question 238
A company hosts an online gaming application on AWS. A single Amazon DynamoDB table contains one item for each registered user. The partition key for each item is the user's ID.
A daily report generator computes the sum totals of two well-known attributes for all items in the table that contain a dimension attribute. As the number of users grows, the report generator takes more time to generate the report.
Which combination of steps will minimize the time it takes to generate the report? (Choose two.)
Answer options
- A. Create a global secondary index (GSI) that uses the user ID as the partition key and the dimension attribute as the sort key. Use the GSI to project the two attributes that the report generator uses to compute the sum totals.
- B. Create a local secondary index (LSI) that uses the user ID as the partition key and the dimension attribute as the sort key. Use the LSI to project the two attributes that the report generator uses to compute the sum totals.
- C. Modify the report generator to query the index instead of the table.
- D. Modify the report generator to scan the index instead of the table.
- E. Modify the report generator to call the BatchGetItem operation.
Correct answer: A, C
Explanation
Option A is correct because creating a global secondary index allows for efficient querying of the dimension attribute while projecting only the necessary attributes, improving performance. Option C is also correct as querying an index is generally faster than scanning the entire table. Options B, D, and E are less effective because they either do not optimize the querying process or complicate the retrieval of needed data.