How to Support Alternative DynamoDB Access Patterns Efficiently?
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?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests your understanding of DynamoDB indexing strategies, where candidates often mistakenly choose LSIs or scans instead of recognizing that only GSIs allow completely different partition and sort key structures from the base table.
To efficiently support new DynamoDB access patterns with different partition or sort keys, Global Secondary Indexes (GSIs) are the recommended solution. The certification community unanimously agrees that GSIs provide optimal performance and operational efficiency over scans, streams, or Local Secondary Indexes.
Option A (LSI) is frequently chosen incorrectly because candidates confuse the key constraints; LSIs require the same partition key as the base table, so order_date cannot serve as a new partition key, making it invalid for this scenario.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Global Secondary Indexes (GSIs) enable you to define a completely different partition key and sort key structure than the base table, directly addressing the requirement to query by order_date and order_id. As a fully managed service, GSIs are automatically kept in sync with the primary table and deliver single-digit millisecond latency without impacting base table read/write performance. This architecture eliminates manual data duplication or complex application-side logic, making it the most operationally efficient solution for handling diverse access patterns.Why the Other Options Are Wrong
Local Secondary Indexes (Option A) are invalid here because they strictly require the same partition key as the base table (customer_id), preventing order_date from acting as a new partition key. Scanning the entire table (Option B) is highly inefficient, wastes read capacity units, and does not scale well as the dataset grows. Enabling DynamoDB Streams (Option D) is designed for change data capture and event-driven workflows, not for serving direct, low-latency query requests based on specific date ranges.Community Comment Notes
Candidates consistently highlight that GSIs provide the necessary flexibility to map entirely new key schemas without restructuring the core table [1]. Multiple experts confirm that choosing a GSI aligns perfectly with AWS best practices for supporting additional access patterns efficiently [2][3]. The discussion reinforces that avoiding full scans and respecting LSI partition key constraints leads directly to the correct exam answer.Official Reference
Exam Strategy
When designing DynamoDB schemas for multiple access patterns, always prioritize Global Secondary Indexes over base table modifications or runtime scanning. Remember that LSIs are strictly limited to sharing the base table's partition key, while GSIs offer complete freedom to define new partition and sort keys.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →