Skip to content

Instantly share code, notes, and snippets.

@bradgignac
Last active January 29, 2016 16:10
Show Gist options
  • Save bradgignac/bdfe566e159a9e85d487 to your computer and use it in GitHub Desktop.
Save bradgignac/bdfe566e159a9e85d487 to your computer and use it in GitHub Desktop.
Vogels Exponential Backoff

Implement Exponential Backoff

The DynamoDB documentation recommends implementing client-side retries with exponential backoff when a ProvisionedThroughputExceededException is received. My team has already implemented this as a wrapper around Vogels, but we'd love to push this feature down into Vogels if you're open to the contribution.

The model definition might be good place to enable this feature. For example:

var Account = vogels.define('Account', {
  hashKey : 'email',
  timestamps : true,
  retries: true,
  schema : {
    email   : Joi.string().email()
  }
});

When this flag is defined, the model should automatically retry all reads and writes in the event of a ProvisionedThroughputExceededException error. It will use full jitter exponential backoff as described by https://www.awsarchitectureblog.com/2015/03/backoff.html.

What do you think?

@brad-f
Copy link

brad-f commented Jan 29, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment