AWS Certified Developer – Associate (DVA-C02) — Question 66

A developer is working on an existing application that uses Amazon DynamoDB as its data store. The DynamoDB table has the following attributes: partNumber (partition key), vendor (sort key), description, productFamily, and productType. When the developer analyzes the usage patterns, the developer notices that there are application modules that frequently look for a list of products based on the productFamily and productType attributes.

The developer wants to make changes to the application to improve performance of the query operations.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

Creating a global secondary index (GSI) with productFamily as the partition key and productType as the sort key allows for efficient querying based on these attributes. Local secondary indexes (LSIs) are not suitable here since they require the same partition key as the base table. Recreating the table is unnecessary and would be more complex, and using Scan operations is inefficient compared to indexed queries.