Reading Just After a Write
A service writes an item to a DynamoDB table and immediately calls GetItem for it. Sometimes it gets the old value. What changes this?
GetItem
Choose one answer
Enable DynamoDB Streams, which makes reads wait for pending writes.
Use ConsistentRead: true on the GetItem call.
ConsistentRead: true
Read through a global secondary index, which is always up to date.
Wrap the write in a transaction with TransactWriteItems so it's visible at once.
TransactWriteItems