-
Notifications
You must be signed in to change notification settings - Fork 26
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
support write/read splitting #6
Comments
It definitely needed, and we have to determine how to set ReadPreference. Then, I came up with the following way. We can define some additional status for a slave like "standby" and "active", and provide a command to set or change <status> , When the status is "standby", slave doesn't receive any access like before. However, this affects only per a group, so it is not so suitable for the people who really want to control a specific key routing. So, maybe we should support some options or commands for client side to guarantee its routing. SETRP master // read only from master. GET abc e.g.2) set as option. GET abc WITHRP slave // read only from slave Is it possible and what do you think? @siddontang |
Hi @kouhate , maybe we can invite codis author @ngaut to discuss here too. I prefer customizing commands, e.g, for every read command, we can add "FROM SLAVE" or "FROM MASTER" in the end. I think "standby" may be unnecessary, if I add a redis into the replication topology, I want it be useful for something, not only for fault tolerance. Btw, we may even do this: for a client connection, if it writes data for a key before, and we will let this client read this key data from master for a while (maybe 1s or 5s), then from slave. |
That's a cool feature. Command like "FROM SLAVE" will make it more clear for users. |
Hi @ngaut , codis will use this feature later? |
@siddontang Do not have any plan right now. I prefer to using scale to get better performance. Any way i like consistency :) |
@siddontang, that's cool to use "FROM SLAVE". "standby" is my fault, not necessary for simple use case:-) balance master 2 slave1 2 slave2 1 This means master get read operation with a 2/5 possibility, slave1 get 2/5, slave2 get 1/5. I think it's good to set those feature on server side globally, then users can modify its feature on client side if needed. But, If you want to avoid complexity, the idea you said before is the best. |
Hi @kouhate , supporting weight for different server may be interesting, but I think I have no time to do it. 😞 These days, I have been studying redis cluster, elasticsearch and other distributed NoSQLs and think maybe we can do better. I will discuss with you using google hangout later. |
OK @siddontang, I hope you could make it good. Btw, that idea is came from a certain NoSQL already used in production. |
Hi @kouhate, Sorry that I mislead you, what I said to do better is not for balance or other xcodis, but that maybe we can do a better cluster solution like elasticsearch supporting node found automatically, data resharding automatically, etc. So I said if I have any idea, I will contact you with google hangout, not here. |
Aha, I don't expect you implement the balance feature. Then, is it ok for you to support FROM SLAVE? |
Yes, I will try to support |
Cool! |
Now ledisdb slaves have no other effect but only replication for data security, we can let them serve some read operations to reduce master pressure if we don't care data consistency too much.
What do you think about this feature? @kouhate
The text was updated successfully, but these errors were encountered: