Exam DVA-C02 All QuestionsBrowse all questions from this 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?

    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
AnandeshOption: B

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

tomchandler077

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.

kyowoOption: B

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

AlagongOption: D

ANSWER IS D

Alagong

ANSWER IS B... NOT D

cachacOption: D

Strongly Consistent Reads