-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add setSelect(ALL_ATTRIBUTES) to retrieve snapshots #12
Conversation
Looks like a nice change! Two thoughts:
|
We'll address point 1 upon rebase. Point 2, while I don't mind the version bump, I don't think there will be a performance impact. It didn't work without projecting all before. If you project all, it will keep on working in the same way it did before (inside Dynamo). Only if you don't project all with will behave differently on on the Dynamo side, but that way of working didn't work before this fix. |
4852e20
to
33cd3df
Compare
By doing so, the indexes don't need to have ProjectionStrategy ALL, but KEYS_ONLY suffices. Thus, a duplicate of the payload doesn't need to be stored in the index, which is more space efficient. This allows to make the choice between time and space efficiency, by selecting the projection strategy for the created index. Depending on the choice, setting this flag for retrieval will make either strategy work as efficient as intended.
33cd3df
to
b277796
Compare
I guess the build failures are unrelated to the feature. |
something weird getting cached on GitHub CI cache storage - I've cleared all the caches and will see what happens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just going to quickly block this because judging from the PR description this should be an option as there are tradeoffs, i.e. speed vs storage?
@spangaer Is this correct? If by default the current behaviour should remain and a config option should be added that enables this behaviour. @coreyoconnor Mayve you can comment here as well?
It is optional. You choose which strategy to follow by means of projection setting for the Dynamo index. https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
So if you configure your index like you had to before, it has no performance implications, but if you switch to keys-only mode, you get the space-time trade-off. |
...rg/apache/pekko/persistence/dynamodb/query/scaladsl/DynamoDBCurrentPersistenceIdsQuery.scala
Show resolved
Hide resolved
Ah I think I am a bit confused here, just to clarify all of these settings are done server side on Amazon Dynamo and so this flag is going to make zero difference wrt behaviour unless you toggle something in AWS Dynamo? |
Correct. The Dynamo Index configuration (projection) determines the performance characteristics, the query setting here is just an enabler to the choice, without impact to existing setups. The change takes effect by switching ALL for KEYS_ONLY. It's also good to have the choices as best practices on the matter tend to be context dependent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay lgtm, just a misunderstanding on my part then
By doing so, the indexes don't need to have ProjectionStrategy ALL, but KEYS_ONLY suffices. Thus, a duplicate of the payload doesn't need to be stored in the index, which is more space efficient.
This allows to make the choice between time and space efficiency, by selecting the projection strategy for the created index. Depending on the choice, setting this flag for retrieval will make either strategy work as efficient as intended.
Draft note
I'm well aware that the rename refactor and deployment processes are still ongoing. We'll adapt these commits to the new reality as it materializes but wanted to stage the contributions already.
Also FYI @coreyoconnor