Comments (2)
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
The individual PutItem and DeleteItem operations specified in BatchWriteItem are atomic; however BatchWriteItem as a whole is not. If any requested operations fail because the table's provisioned throughput is exceeded or an internal processing failure occurs, the failed operations are returned in the UnprocessedItems response parameter. You can investigate and optionally resend the requests. Typically, you would call BatchWriteItem in a loop. Each iteration would check for unprocessed items and submit a new BatchWriteItem request with those unprocessed items until all items have been processed.
So this is legit, thanks for pointing out :) . However i'm slightly concerned about the interface here, since there are many options we can customize. (How many retries / Delay between retry / What happens when insert keeps fails)
For
- How many retries (even "infinite" until unprocessed items become empty)
- Delay between retries,
we can decide some default value on library level and let user to customize it if they want i guess? which would be sufficient for most of common use cases anyway. So that keep code not be rewritten because of this change.
(if we add "maximumRetry" as required parameter on batchDelete / batchPut, that would require existing codes to revised)
But
- When the maximum number of retries all fails, what happens?
is a bit more complicated problem. should we just raise an error? or... let me know if you have an opinion on this. I'd do this personally if the specification become more clear! this is something we've been clearly missing
from dynamo-types.
Sorry for the delay in responding. Since the error message only comes about through throttling and eventually throttling will let it through, infinite is probably not a bad option. (I'm using this in a lambda function which would time out on its own in 5 minutes or less, I'm not sure what a standard node function would do if a runaway process can be killed by the node engine with express. But the throttling by definition basically says "eventually this will succeed")
For delay strategy, probably an exponential backoff strategy would be best, though maybe a setting between exponential and linear would be better.
from dynamo-types.
Related Issues (20)
- AWS_XRAY_CONTEXT_MISSING and AWS_XRAY_DAEMON_ADDRESS is set HOT 4
- Conditional updates? HOT 11
- Feature Request: Ability to specify type in decorator, to allow Class type HOT 2
- Rename the repo 'dynamo-types'? HOT 3
- CreateTable fails when using TTL field with local-dynamo HOT 5
- node version? HOT 5
- Is this project still maintained? HOT 2
- Scan on global secondary index? HOT 3
- Query.GlobalSecondayIndex.scan doesnโt pass IndexName HOT 1
- Add AWS config to documentation HOT 2
- Remove `Decorator` namespace HOT 1
- Table decorator: Create table if it does not exist HOT 1
- Improve documentation HOT 1
- Is there a way to update only part of a map? HOT 2
- Is there a way to apply filters expression on query HOT 1
- no initializer error HOT 2
- Increment value in DynamoDB table HOT 1
- updates on lists
- This repository will no longer be maintained. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamo-types.