Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DynamoDB Batch Update

Is there any API in DynamoDB to update a batch of items? There is an API to write new items in batches (BatchWriteItem) and update single item using UpdateItem, but is it possible to update multiple items in one call?

like image 756
user1846749 Avatar asked Nov 08 '16 04:11

user1846749


People also ask

Can we do batch update in DynamoDB?

A bulk (batch) update refers to updating multiple rows belonging to a single table. However, DynamoDB does not provide the support for this.

How do I update a DynamoDB item?

To update an existing item in an Amazon DynamoDB table, you use the UpdateItem operation. You must provide the key of the item that you want to update. You must also provide an update expression, indicating the attributes that you want to modify and the values that you want to assign to them.

What is batch in DynamoDB?

The BatchWriteItem operation puts or deletes multiple items in one or more tables. A single call to BatchWriteItem can transmit up to 16MB of data over the network, consisting of up to 25 item put or delete operations.

How long does it take for DynamoDB to update?

How long does it take to update DynamoDB item? It's instant once you commit your save. The API operation completes usually in less than 100ms.


2 Answers

There is no batch update item API available in DynamoDB at the moment.

DynamoDB API operations list

like image 141
notionquest Avatar answered Sep 26 '22 03:09

notionquest


I know this is an old question by now, but DynamoDB recently added a Transaction api which supports update:

Update — Initiates an UpdateItem operation to edit an existing item's attributes or add a new item to the table if it does not already exist. Use this action to add, delete, or update attributes on an existing item conditionally or without a condition.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html

like image 36
Chris Barrett Avatar answered Sep 23 '22 03:09

Chris Barrett