-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use AWS Redis Primary Endpoint & Reader Endpoint #2503
Comments
Hi, I'm honestly not sure about this one since I've never tried it. My instinct is that if AWS is doing the load balancing you probably don't want to set Also that shouldn't be why we can't map the cluster. I probably need to play around with this in a small test cluster to figure out what's going on. Is it possible that AWS is doing the "cluster" work for you and you want to use the non-cluster You can also try running this utility script I created a while back that just tries to map out cluster topology with the |
Thank you for your reply.
Yes, that is very possible. Using
Yes, the Redis cluster mode is not active. AWS is doing the "cluster" work for me.
|
We'd have to add that feature to the extension to do that transparently. It could also be done purely in userland PHP by proxying two If this is a common setup in AWS it might be worth adding to PhpRedis. |
That is where I started =)
I cannot say how popular it is. But I did some research on Google Cloud. Both AWS and Google cloud have 3 options. (A) One node, (B) cluster mode or (C) one write node with many read replicas. Note that all read replicas are sharing one endpoint. I would be interested to see this feature in PhpRedis. |
So this is sort of:
This wouldn't be a cluster then, it would be the plain |
Yes, that is very much the idea. |
Who's in charge of solving eventual consistency? If you send a write and then immediately a read for the same key, you're bound to get inconsistencies with the most basic approach, right? Or do they fix it for you in their proxy somehow? |
The platform (AWS/Goggle) is. And the application. We would never want the PHP extension to keep state. For the application: A common setup is to use chain cache. Ie you have an in-memory (or APCu) cache in front of Redis. For the platform: The smart people att AWS/Google are doing their best to reduce the time window for inconsistencies. |
How big of a task is this to implement? Ie, is this a massive job or is it something I should try myself over a few weekends? |
Using AWS, you may setup multiple Redis nodes and they run with
cluster_mode=disabled
.AWS will give you a write endpoint and a read endpoint. AWS will automatically load balance the read requests between nodes.
Expected behaviour
Actual behaviour
When instantiating
RedisCluster
aRedisClusterException
is thrown with:I assume it is because I am trying to use the
RedisCluster
class when my nodes has disabled cluster mode. I am curious how I could separate my reads from my writes easily with this setup.I'm seeing this behaviour on
Steps to reproduce, backtrace or example script
I've checked
develop
branchI've seen related issues like: #1899
The text was updated successfully, but these errors were encountered: