stephenbez
stephenbez

Reputation: 5658

DynamoDB: Is adding an item using list_append atomic?

The FAQs for DynamoDB says:

Q: Does DynamoDB support in-place atomic updates?

Amazon DynamoDB supports fast in-place updates. You can increment or decrement a numeric attribute in a row using a single API call. Similarly, you can atomically add or remove to sets, lists, or maps. View our documentation for more information on atomic updates.

When you click the link for more documentation, it has no more info about adding to sets.

Based on this I would think adding to a list/set using the ADD keyword would be atomic.

But would adding to a list using the list_append function also be atomic? Is there any other documentation about this?

Upvotes: 3

Views: 3573

Answers (1)

Alexander Patrikalakis
Alexander Patrikalakis

Reputation: 5205

All single-item updates to items using the UpdateItem API are atomic. Therefore, using list_append() in an UpdateExpression is also atomic.

Upvotes: 4

Related Questions