clarkie / dynogels

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

Difference b/w creating one doc vs multiple #98

Closed tarunbatra closed 7 years ago

tarunbatra commented 7 years ago

Model.create can take either one doc or an array of them. I'm curious if giving an array at once will likely cross the provisioned capacity of the DynamoDB table (assuming it's very low), or dynogels does some kind of throttling?

clarkie commented 7 years ago

Dynogels doesn't do any throttling of batch requests. The AWS-SDK does have automatic retrying if you exceed your provisioned throughput.

ProvisionedThroughputExceededException

Message: You exceeded your maximum allowed provisioned throughput for a table or for one or more global secondary indexes. To view performance metrics for provisioned throughput vs. consumed throughput, open the Amazon CloudWatch console.

Example: Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests, using Error Retries and Exponential Backoff.

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.MessagesAndCodes

I hope that helps.