-
Notifications
You must be signed in to change notification settings - Fork 987
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 support for ReadFrom.subnet #1569
Comments
#1570 |
Lettuce now supports ReadFrom.subnet which is an option of reading from any node in the given subnets.
Thanks a lot. It makes sense to use netty utilities to build a subnet-based |
Lettuce now supports ReadFrom.subnet which is an option of reading from any node in the given subnets. Original pull request: #1570.
Feature Request
I want
ReadFrom.Subnet
feature which read from any node in the configured subnets.Original motivation of this proposal is, I want to read from a (AWS elasticache) redis node in the same availability zone from an application.
Reading from the same availability zone reduces latency and costs as AWS charges traffics between different availability zones.
While AWS claims
AZs are engineered to provide low latency network connectivity to other AZs in the same region
(see link), a simple benchmark shows crossing availability zone leads bad latency:Currently lettuce supports
ReadFrom.NEAREST
, a option of reading from any node with the lowest latency.For my usecase it would work well if there is only one node in an availability zone.
However if there are more than two nodes in an availability zone, the option may lead unbalanced loads between the nodes.
Imagine that an extreme case - there are two read replicas in an availability zone and one lettuce application with
NEAREST
option deployed to the same availability zone with the replicas, the application always reads from one read replica and the other one is not used until the next topology refresh. (I did not testNEAREST
actually, sorry if I am wrong)I believe lettuce should be vendor-independent and avoid AWS specific APIs, so I want to propose to use subnets to read from a node of the same availability zone.
I think we can use this feature for other clouds or on-premises.
As you know lettuce is well-designed and I can implement such
ReadFromSubnet
class by myself in my project, but I believe this feature will be in demand to other developers.If my proposal seems reasonable I can submit a PR.
Is your feature request related to a problem? Please describe
Crossing availbility zone leads bad latency and costs.
Describe the solution you'd like
Add support
ReadFromSubnet
feature:To calculate subnet netty's
IpSubnetFilterRule
seems good as we do not need additional dependency.Describe alternatives you've considered
AWS API like DescribeCacheClusters would work,
but we need an elephant
awssdk
dependency and this makes lettuce vendor locked-in.Teachability, Documentation, Adoption, Migration Strategy
We need to add information to wiki page.
Example
The text was updated successfully, but these errors were encountered: