DVA-C02 Exam QuestionsBrowse all questions from this exam

DVA-C02 Exam - Question 361


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?

Show Answer
Correct Answer: B

To query a DynamoDB table using the same partition key but a different sort key value, a Local Secondary Index (LSI) should be added during table creation. LSIs allow queries on attributes using the same partition key and an alternative sort key. Strongly consistent reads ensure that the query returns the most up-to-date data, fulfilling the requirement of obtaining the latest data with all recent write operations.

Discussion

5 comments
Sign in to comment
kyowoOption: B
Jul 5, 2024

Considering developer wants to query by using the same partition key and a different sort key value, so B it's the correct answer

tomchandler077
Jul 7, 2024

The correct answer is: B. Local Secondary Index (LSI): An LSI allows you to create an index with a different sort key for the same partition key as the base table. This lets you query the table using the same partition key but with a different sort key. LSIs are created at the same time as the table and cannot be added to an existing table. Strongly consistent reads ensure that you always receive the most up-to-date data after all previous write operations are acknowledged. This is important when the developer needs to ensure they are getting the latest data, as stated in the question.

AnandeshOption: B
Jul 10, 2024

GSI - diff part key and sort key | LSI - same part key and diff sort key Strongly consistent - most recent data

cachacOption: D
Jun 30, 2024

Strongly Consistent Reads

AlagongOption: D
Jul 2, 2024

ANSWER IS D

Alagong
Jul 2, 2024

ANSWER IS B... NOT D