QuestionQ70

VerifiedDeployment

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?

Explanation

Global Secondary Indexes (GSI) allow completely different partition and sort keys from the main table. LSI must retain the same partition key as the table. To query by order_date and order_id (a new access pattern), a GSI with order_date as partition key and order_id as sort key enables efficient querying. Scanning (B) is inefficient; DynamoDB Streams (D) are for change events, not query support.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!