Search code examples
amazon-dynamodb

DynamoDB consistency


I'm building an web application, which uses DynamoDB as its database. I understand by default DynamoDB is eventual consistency. My application is set up such that the user is only interested in their data, that means a user won't depend on other dynamic data, but their own. Let's say a user reads(GET) their name=hello. They change(POST) it to name=world. Can the subsequent GET be guaranteed to be name=world? I'm talking about the case where the user sits in front of one machine at a one geographical location.

Another question is that if I configure DynamoDB to 'consistent read', would that solve the problem if the answer to above is no?

Thank you for any feedback in advance!


Solution

  • The first answer is no, it's not guaranteed but is usually up to date within a millisecond but because you cannot guarantee that, then you must configure your reads to be consistent.

    Consistency can be set on a per request basis, and 90% of use cases can tolerate the couple of milliseconds lag in consistency.

    Have a read of the docs for more info.