Is DynamoDB DeleteItem read-consistent?

0

Dear Experts,

DynamoDB GetItem operations can be read-consistent or not. But there isn't a corresponding setting for DeleteItem. So are DeleteItem operations consistent?

I.e. if one connection does a PutItem, and then another connection does a DeleteItem with the same key, is it guaranteed that the just-put item is actually deleted?

In my case I'm using SetReturnValues(ALL_OLD) to both read and delete an item, if that makes any difference.

Thanks, Phil.

gefragt vor 2 Jahren1127 Aufrufe
2 Antworten
1
Akzeptierte Antwort

Consistency is a term which relates to reads only. All write operations are atomic and will appear in the order they are received, so yes, if you call DeleteItem after a PutItem then it is guaranteed to be deleted.

However, if you call DeleteItem and then PutItem, the item will be there as the PutItem was the last called event. You can add logic to your PutItem with a ConditionExpression to only write if it does not already exist.

profile pictureAWS
EXPERTE
beantwortet vor 2 Jahren
0

Nice question....I can't find any specific documentation but a DeleteItem (as well as PutItem) operation would be considered a write operation and according to docs - "When your application writes data to a DynamoDB table and receives an HTTP 200 response (OK), the write has occurred and is durable".

AWS
EXPERTE
Peter_G
beantwortet vor 2 Jahren
  • I don't think that "durable" is the property that I need here. Remember the database "ACID" properties. C = consistent, D = durable. They're different things.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen