Skip to content

Add DynamoDBMapperConfig caching #1235

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

Closed
ogmios-voice opened this issue Jul 16, 2017 · 1 comment
Closed

Add DynamoDBMapperConfig caching #1235

ogmios-voice opened this issue Jul 16, 2017 · 1 comment
Labels
feature-request A feature should be added or improved.

Comments

@ogmios-voice
Copy link

Instead of creating a new builder and a new config object (and doing all the merging) for every operation with a DynamoDBMapperConfig parameter, AbstractDynamoDBMapper should cache and reuse these configurations. WeakHashMaps (with optional SoftReferences) should do the trick, or use some third party caching solution.
As an intermediate but also more secure solution, you might even extend DynamoDBMapperConfig with a (boolean) shouldCache field, and cache only these configurations.

Basically you should do the same with all of your *Config classes and wherever you might have the possibility to reuse objects instead of creating functional duplicates (in the whole sdk).
(And of course to benefit from it, your users should use reusable (e.g. static/singleton) config parameters, so you might wanna propagate this in the javadoc too.)

@kiiadi kiiadi added the feature-request A feature should be added or improved. label Jul 17, 2017
@debora-ito
Copy link
Member

Hi @ogmios-voice,

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 one.

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