user7340
user7340

Reputation: 274

DynamoDb Eventual Consistency: the index or the record?

In DynamoDb, reads using Global Secondary Indexes are eventually consistent by default: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html#GSI.Querying

However, does that mean queries to a GSI may return one of the following:

  1. The old set of records with the old values
  2. The old set of records with the new values
  3. The new set of records, but the attributes of the record will be old

Example for clarification:

Result X - Wrong Set but Right Attribute Values: {a: 1, b: apple, c: orange}

Result Y - Right Set but Wrong Attribute Values: {a: 1, b: apple, c: blue} {a: 2, b: orange, c: green}

Result Z - Wrong Set and Wrong Attribute Values: {a: 1, b: apple, c: blue}

or something else?

Upvotes: 0

Views: 441

Answers (1)

jellycsc
jellycsc

Reputation: 12259

Queries on the GSI will sometimes return the old set of records

Yes

Queries will return the new set of records, but the attributes of the record will be old?

This will never happen.

Upvotes: 1

Related Questions