How to resolve stale data display in DynamoDB


Trouble details

DynamoDB to manage customer session data. We have received complaints that users are seeing stale data when they access the database.



  1. Change the data integrity model of dynamo DB



When reading data from Amazon DynamoDB, users can specify whether to set resultant consistency or strong consistency for that read. Selecting the resultant-consistent model maximizes read throughput. However, result consistent reads may not reflect the latest write results. Consistency of all copies of data typically takes place in less than one second. Repeating the read after a short period of time returns updated data. In this case, it is thought that stale data was viewed because the read was performed before the updated data was reflected. Therefore, the appropriate response is to change the result consistency model to a strong consistency model.

In addition to result consistent reads, DynamoDB provides the flexibility and control to request strong consistent reads. The result of a strongly consistent read reflects all writes that received an appropriate response prior to the read.