Based on DynamoDb documentation why would anyone use updateItem
instead of putItem
?
PutItem
- Writes a single item to a table. If an item with the same primary key exists in the table, the operation replaces the item. For calculating provisioned throughput consumption, the item size that matters is the larger of the two.UpdateItem
- Modifies a single item in the table. DynamoDB considers the size of the item as it appears before and after the update. The provisioned throughput consumed reflects the larger of these item sizes. Even if you update just a subset of the item's attributes,UpdateItem
will still consume the full amount of provisioned throughput (the larger of the "before" and "after" item sizes).