AWS Certified Developer – Associate (DVA-C02) — Question 274
A company runs an application on AWS. The application stores data in an Amazon DynamoDB table. Some queries are taking a long time to run. These slow queries involve an attribute that is not the table's partition key or sort key.
The amount of data that the application stores in the DynamoDB table is expected to increase significantly. A developer must increase the performance of the queries.
Which solution will meet these requirements?
Answer options
- A. Increase the page size for each request by setting the Limit parameter to be higher than the default value. Configure the application to retry any request that exceeds the provisioned throughput.
- B. Create a global secondary index (GSI). Set query attribute to be the partition key of the index.
- C. Perform a parallel scan operation by issuing individual scan requests. In the parameters, specify the segment for the scan requests and the total number of segments for the parallel scan.
- D. Turn on read capacity auto scaling for the DynamoDB table. Increase the maximum read capacity units (RCUs).
Correct answer: B
Explanation
Creating a global secondary index (GSI) with the query attribute as the partition key allows the application to query on non-key attributes efficiently without performing costly full table scans. While parallel scans or increasing RCUs might temporarily handle larger workloads, they do not address the underlying performance issue of querying non-key attributes and will significantly increase costs as data volume grows. Adjusting the Limit parameter actually reduces performance by fetching more items per page, which is counterproductive.