clarkie / dynogels

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

Why to have a retry logic in Dynogels when AWS SDK does it better #101

Closed surajwy closed 7 years ago

surajwy commented 7 years ago

Hi,

At this place in utils.js, we are retrying infinitely in the case when AWS is down or has some network issues. Is there a need for the dynogels module to have its own retry? Shouldn't we just raise the error that we have got from AWS SDK?

Please provide your opinion on this. I believe only AWS SDK should have retry logic and Dynogels should just pass the error back to the callback. Dynogels should just be a proxy.

Thanks, Suraj

clarkie commented 7 years ago

The retry logic is there for when your requests get throttled by dynamodb. I guess this could be customisable but right now it suits my needs to have the retry handled inside dynamo and for my app to not have to worry about whether to retry or not.

surajwy commented 7 years ago

You have a point that it should be customizable. My use case is a web server where I can not block a request for too long. I can throw an error and my clients have got retry baked in them.

Thanks for your reply. I'll remove this if clause for now.