
Answer-first summary for fast verification
Answer: Use ConsistentRead = true while doing GetItem operation for any item
Use ConsistentRead = true while doing GetItem operation for any item DynamoDB supports eventually consistent and strongly consistent reads. Eventually Consistent Reads When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation. The response might include some stale data. If you repeat your read request after a short time, the response should return the latest data. Strongly Consistent Reads When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. DynamoDB uses eventually consistent reads by default. Read operations (such as GetItem, Query, and Scan) provide a ConsistentRead parameter. If you set this parameter to true, DynamoDB uses strongly consistent reads during the operation. As per the given use-case, to make sure that only the last updated value of any item is used in the application, you should use strongly consistent reads by setting ConsistentRead = true for GetItem operation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
The technology team at an investment bank leverages Amazon DynamoDB to support high-frequency trading operations. In this scenario, it’s common for multiple trades to attempt to update the same item concurrently.
To ensure that only the most recently updated value of any item is retained and used in the application, which of the following actions would be appropriate?
A
Use ConsistentRead = false while doing PutItem operation for any item
B
Use ConsistentRead = true while doing GetItem operation for any item
C
Use ConsistentRead = true while doing PutItem operation for any item
D
Use ConsistentRead = true while doing UpdateItem operation for any item
No comments yet.