Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return ConsumedCapacity in DynamoDBMapper's load(), save() and delete() methods #1170

Closed
daniil-dubin opened this issue May 29, 2017 · 4 comments
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@daniil-dubin
Copy link

daniil-dubin commented May 29, 2017

Information about consumed capacity would be very handy to optimize the load on DB but it's not returned by load(), save() and delete() methods of DynamoDBMapper. Even though underlying AmazonDynamoDBClient provides it, it's simply discarded.
We can change

public <T> void delete(...)
into
public <T> ConsumedCapasity delete()

The question is how to modify load() and save() method's signature so that to enable return of consumed capacity.The alternatives are: an extra wrapper over result (extra GC pressure) or the overloaded version with listener (which is less comfortable to use).

Any ideas what way to follow? Once decided I can contribute.

@varunnvs92 varunnvs92 added the feature-request A feature should be added or improved. label May 29, 2017
@varunnvs92 varunnvs92 self-assigned this May 30, 2017
@varunnvs92
Copy link
Contributor

varunnvs92 commented May 31, 2017

How is the returned ConsumedCapacity used? Is this commonly used feature that requires integration into the SDK?

@daniil-dubin
Copy link
Author

daniil-dubin commented Jun 6, 2017

ConsumedCapacity contains information about how much of provisioned read/write capacity has been consumed to execute the particular request to dynamodb.

ConsumedCapacity could be used in variety of ways. In particular, I am going to use this data to adjust intensity of requests to DB and maintain the amount of consumed read/write capacity on the near to constant level. This technique allows more control and better load distribution than just making as many request as possible until having them throttled and then doing exponential back-off.

It's been already integrated into SDK namely GetItemResult and UpdateItemResult contain ConsumedCapacity. It's just a problem with DynamoDBMapper that it ignores it.

@varunnvs92
Copy link
Contributor

We are working on a v2 version of the SDK which we plan to release later this year. We are looking at making major changes in DynamoDBMapper. We can consider this feature request in the new version but we don't have bandwidth to add this feature to current dynamodb mapper. If you can send us a PR, we can certainly look at that.

@debora-ito
Copy link
Member

Hi @daniil-dubin, the SDK team has reviewed the feature request list for V1, and since they're concentrating efforts on V2 new features they decided to not implement this one in V1. It's still being considered for the DynamoDB Mapper refactor in V2, see the referenced issue above. I'll go ahead and close this.

Please feel free to comment on the V2 issue with your use case, and reach out if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants