- Newest
- Most votes
- Most comments
Eventual consistency means consistency is usually achieved within a second. So if the records have been there a while then no, you won't need to do a strongly-consistent read.
Hi,
Which consistency rule did you apply to your DDB table? By default it is "eventually consistent" which means:
When issuing eventually consistent reads to a DynamoDB table or an index,
the responses may not reflect the results of a recently completed write operation.
If you repeat your read request after a short time, the response should eventually
return the more recent item.
as per documentation at https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html
In your use case, you may want to use Strongly Consistent Read.
Best,
Didier
Seems odd, but I've read lots of documentation. I will give this a try.
response = table.query(KeyConditionExpression=Key('Username').eq(myUsername) consistent_read=True )
Is this the correct syntax? Also, are there additional costs involved adding this to every read operation?
Well, that didn't work! The error indicated this option is not allowed on the query method, suggesting it should be on the table method. So:
table= dynamodb.Table("D1UsersLookup", consistent_read=True) That also didn't work:. Error: errorMessage": "Unknown keyword argument: consistent_read",
What I don't understand is that the data has been in the table for 24 hours. Surely it should be able to be queried on or scanned?!?!
Relevant content
- Accepted Answerasked 3 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
I have switched to performing a scan instead of a query. It's finding one of the records I placed in the terminal a day ago. I does NOT find the record I placed in the table 2 hours ago.....Does anyone know what is going on? Help, please?