clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels
Other
490 stars 110 forks source link

BatchWriteItem ? #123

Closed iDVB closed 6 years ago

iDVB commented 6 years ago

Is this method not supported somehow in dynogels?

"The BatchWriteItem operation puts or deletes multiple items in one or more tables. A single call to BatchWriteItem can write up to 16 MB of data, which can comprise as many as 25 put or delete requests. Individual items to be written can be as large as 400 KB." http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#batchWriteItem-property

cdhowie commented 6 years ago

This method is not yet supported.

Dynogels does support creating multiple items (model.create([item1, item2, item3], callback)) and these are processed in parallel, but in multiple requests.

@clarkie I can't imagine it would break anything to make this do a batch write behind the scenes? There's some complexity since there's a limit to the amount of data you can write in a single request, but if we can solve that, then we could provide a performance boost for this existing use case.

So @iDVB, I would suggest using the array form of model.create() under the assumption that we will implement batch writes for that specific invocation later.

cdhowie commented 6 years ago

Actually, this is a duplicate of #43. Moving discussion there.