1

As per

Dynamodb does not support batchupdate only batchwrite/put is supported . But DynamoDBMapper supports batchWrite with a behaviour of UPDATE_SKIP_NULL_ATTRIBUTES. Does it mean internally mapper calls single single update instead of batchupdate for UPDATE_SKIP_NULL_ATTRIBUTES ?

1 Answer 1

2

When you use BatchWrite, it replaces the existing items(Not update). Even if you use DynamoDBMapper, the functionality should be the same.

According to the DynamoDBMapper source code, SaveBehavior with UPDATE_SKIP_NULL_ATTRIBUTES, it ultimately calls BatchWriteItemRequest iteratively in 25 batch size, which replaces the existing items.

Check the following statement in AWS Class Reference Documentation.

NOTE: BatchWriteItem cannot update items. To update items, use the UpdateItem API.

Sign up to request clarification or add additional context in comments.

2 Comments

by default yes it replaces but when you set in DynamoDBMapperConfig withSaveBehavior(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES) then also does it replaces existing item or skip the null attributes ?
Check the updated answer :), I just gone through the source code and checked whats happening internally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.