[v3.x] Use Replicas For Read#1430
Open
Cardmarket-Sijing wants to merge 6 commits into
Open
Conversation
* Added separate pool and slot map for cluster replicas * Use replicas to serve read requests This adds a dependency on the replication strategy for detecting read commands. The detection could be moved to the redis cluster strategy or to a separate class included in both strategies. Also this doesn't allow for the user to configure if and how the replicas should be used. Future improvements could be: * prefer replicas for reads, fallback to primary * randomly select between replicas and primaries to evenly distribute This splits up the slots of the primary between replicas. Another idea would be to share the slots between all replicas and select the replica (randomly) for each command
Disable load balancing behavior by default to ensure backwards compatibility. Redis Cluster now takes the `loadBalancing` option into account
Added documentation for the cluster load balancing option
Author
|
Linting errors in unchanged files seem out of scope |
Member
|
@vladvildanov Should we try to do this without a breaking change, or niche enough? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
original PR: #1411
PR for v2.x: #1414
This is a proposition on how load could be balanced for replicated clusters.
See:
#595 #392 #173 #579
Added separate pool and slot map for cluster replicas
Use replicas to serve read requests
This adds a dependency on the replication strategy for detecting read commands. The detection could be moved to the redis cluster strategy or to a separate class included in both strategies.
Also this doesn't allow for the user to configure how the replicas should be used. Future improvements could be:
prefer replicas for reads, fallback to primary
randomly select between replicas and primaries to evenly distribute
This splits up the slots of the primary between replicas. Another idea would be to share the slots between all replicas and select the replica (randomly) for each command