aws/aws-sdk-js

Question: Exponential backoff for DynamoDB would be triggered only if the entire items from a batchWrite() call failed or even if just some items failed?

develoser opened this issue · 3 comments

Got a question about DynamoDB.batchWrite(), the SDK exponential backoff is only triggered when the whole batch of items failed or it would be also triggered even when just a few items failed to be written?

I saw this previous questions and realized the SDK can handle retries, but is not clear to me if it handles all scenarios:

a) all items failed
b) just some items failed

I wanna know if I need to write my own exponential backoff handler when the batchWrite() returns some "UnprocessedItems", in order to do not end up coding what the SDK already does or to lose UnprocessedItems assuming the SDK is doing something it is not.

Thanks in advance.

The SDK will only retry requests that fail with a status code of 429 or 500 or greater. If only some writes in a batch failed, the request is considered by the service to have succeeded and is therefore not retried.

Retrying items in the UnprocessedItems list in the response would need to be handled in the code that is calling batchWrite.

Thank you so much, it's clear now.

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.