Exam DVA-C02 All QuestionsBrowse all questions from this exam
Question 362

A developer manages an application that writes customer orders to an Amazon DynamoDB table. The orders use customer_id as the partition key, order_id as the sort key, and order_date as an attribute. A new access pattern requires accessing data by order_date and order_id. The developer needs to implement a new AWS Lambda function to support the new access pattern.

How should the developer support the new access pattern in the MOST operationally efficient way?

    Correct Answer: C

    The most operationally efficient way to support the new access pattern is by adding a new global secondary index (GSI) to the DynamoDB table that specifies order_date as the partition key and order_id as the sort key. GSIs provide the flexibility to query items using different attributes than the primary key, without scanning the entire table. This approach allows efficient querying based on order_date and order_id, which aligns with the new access pattern requirements.

Discussion
tomchandler077

C Global Secondary Index (GSI) allows you to specify a completely different partition key and potentially a different sort key from those on the main table. This flexibility is crucial when you need to support additional access patterns that aren't directly supported by the existing table's key structure. In this scenario, specifying order_date as the new partition key and order_id as the sort key in a GSI will enable efficient querying based on these attributes. Lambda Function Querying GSI: Once the GSI is set up, the Lambda function can perform efficient query operations directly on this index to fetch records based on order_date and order_id, which is much more efficient than scanning the entire table.

domboxOption: C

C is correct

rdiazOption: C

C is the correct answer

kyowo

C is the correct answer