Search code examples
amazon-dynamodbdynamodb-queries

DynamoDB: Batch update without aborting transaction if one or more update fails


I want to perform a DynamoDB batch update where I want to update multiple items in a batch (or transaction).

I've tried using a TransactWrite query, which does work with batching the updates, however if one of the updates fails the entire transaction fails which I do not want.

I would ideally want similar functionality to BatchWrite, but at the time of writing that does not support updates.

Is there any workaround to achieve this?


Solution

  • You can use PartiQL BatchExecuteStatement to achieve your use-case.

    • The entire batch must consist of either read statements or write statements; you cannot mix both in one batch.

    • BatchExecuteStatement just like BatchWriteItem can perform no more than 25 statements per batch.