spring-data-dynamodb
spring-data-dynamodb copied to clipboard
How to handle strongly consistent reads non-globally?
My first idea was to add new annotation @StronglyConsistentRead but realized that whether or not you want strongly consistent reads might vary from call to call and a single repo method wouldn't allow that.
My second idea was to add WithConsistentRead to the method name to allow for an eventually consistent method and strongly consistent method.
Optional<T> findById(T id);
Optional<T> findByIdWithConsistentRead(T id);
If this seems like a reasonable solution, I might fork and give it a try.
Ok, I just found the @Query annotation. I could add boolean stronglyConsistent() default false there, but then would need a way to ignore a part of the method name so the two methods above could both exist in the same interface.
@efenderbosch this will be useful is there a PR or has this already been implemented .
I was considering implementing, but looking for guidance on how best to do it. Some input from the devs would be helpful.
I was considering implementing, but looking for guidance on how best to do it. Some input from the devs would be helpful.
some annotation like @consistentReads over the methods looks better to me as we would not want to change the spring data constructs here .
Hi, I'm wondering the same thing. Is there any update on how to handle strongly consistent reads?