GithubHelp home page GithubHelp logo

clarify retry strategy about dynamo HOT 8 CLOSED

jed avatar jed commented on May 26, 2024
clarify retry strategy

from dynamo.

Comments (8)

mhart avatar mhart commented on May 26, 2024

The tricky thing about this is that there is some DynamoDB-specific logic that needs to be dealt with - and leaving this up to the user unnecessarily burdens them IMO.

Some examples of the sorts of things that other client libraries deal with:

https://github.com/amazonwebservices/aws-sdk-for-php/blob/master/sdk.class.php#L936-977

https://github.com/boto/boto/blob/develop/boto/dynamodb/layer1.py#L150-179

https://github.com/teleportd/node-dynamodb/blob/master/lib/ddb.js#L918-950

So it might be OK to exclude this from the lib - but I think it would be really nice to include an example of the things you need to keep in mind when retrying, or even better, a util to do the retrying so that users can opt in.

from dynamo.

jed avatar jed commented on May 26, 2024

good points, @mhart, and thanks for the other references. it seems there's enough consensus here.

how about this: we handle all retry logic according to best practices (backoff, etc) for the next function, but allow the user to decide whether to call it or not. thoughts?

from dynamo.

mhart avatar mhart commented on May 26, 2024

I guess I haven't used it enough in production yet to know what the most likely use case would be.

My main question is: when would you not want to retry? Are there any examples you know of using the other APIs where the retry has somehow bitten people? (... checks Google ... can't find anything - the only cases I could imagine it would be a problem would be the non-idempotent ones, incrementing counters, non-conditional updates, etc)

from dynamo.

jed avatar jed commented on May 26, 2024

it's not that you wouldn't want to retry so much as you may want to retry on your own terms. but the more i think about it, the less i'm inclined to expose it. perhaps setting maxRetries for a client is enough?

from dynamo.

mhart avatar mhart commented on May 26, 2024

Yeah - I think that'd be perfect - then if someone doesn't want to (which I'm pretty sure would not be the norm), then they can specify 0 maxRetries or whatever.

from dynamo.

mhart avatar mhart commented on May 26, 2024

Perhaps down the track you could allow tuning of the backoff, allow a retry function to be passed in, something like that.

from dynamo.

jed avatar jed commented on May 26, 2024

by the way, this has been added to jed/dynamo-client@efd8e0d.

from dynamo.

mhart avatar mhart commented on May 26, 2024

Schweeet

from dynamo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.