A developer is writing an application, which stores data in an Amazon DynamoDB table. The developer wants to query the DynamoDB table by using the partition key and a different sort key value. The developer needs the latest data with all recent write operations. How should the developer write the DynamoDB query?
- AAdd a local secondary index (LSI) during table creation. Query the LSI by using eventually consistent reads.
- BAdd a local secondary index (LSI) during table creation. Query the LSI by using strongly consistent reads. (correct answer)
- CAdd a global secondary index (GSI) during table creation. Query the GSI by using eventually consistent reads.
- DAdd a global secondary index (GSI) during table creation. Query the GSI by using strongly consistent reads.
Reveal answer & explanationHide answer
The correct answer is B. Option B: Add a local secondary index (LSI) during table creation. Query the LSI by using strongly consistent reads.