- Newest
- Most votes
- Most comments
GSI's are eventually consistent, and unfortunately there is no upper bound to eventual in this context.
What I can say is that GSI's are consistent within a second under normal working conditions, but as DynamoDB is a large scale distributed system, then issues can arise (such as leader failover, node failure etc....).
My suggestion would be not to rely on the consistency of an eventually consistent system, if you need strong consistency, consider using an LSI. If you need strong consistency but with different partition key, you can make use of a second table and use TransactWriteItem API to maintain an index on the second table.
TLDR; Global Secondary Indexes have no upper bound on being consistent.
Hi,
To get a better understanding of the latency <> consistency compromise of DDB: see this article: https://www.alexdebrie.com/posts/dynamodb-eventual-consistency/
It points to some Github repo https://github.com/alexdebrie/dynamodb-performance-testing/tree/master/consistency-performance where final section of the README.md gives some numbers about latency for GSI consistency
Best,
Didier
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated a year ago
These numbers are biased towards that users specific use-case at that time. It does not allow for transient issues such as network blips or any other sort of failure. It would be wrong to take any sort of dependency on those numbers.