Skip to content
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

can we use KingShard for the MinReplication Load Balancing #36

Closed
pm-kartik-sura opened this issue Sep 11, 2015 · 8 comments
Closed

can we use KingShard for the MinReplication Load Balancing #36

pm-kartik-sura opened this issue Sep 11, 2015 · 8 comments

Comments

@pm-kartik-sura
Copy link

Use case:
The kingshard will connect to multiple slaves, the requests will go to the node with the minimum replication lag.

Also one question: does the proxy speak Mysql protocol? That is can I connect to the proxy like any other mysql server (from C program)?

If the functionality is not there, I would like to contribute. (Please provide the documentation in English)

@flike
Copy link
Owner

flike commented Sep 11, 2015

yes, you can use kingshard as a mysql server. It speak Mysql protocol.

@pm-kartik-sura
Copy link
Author

Thanks a lot flike!
What about the distribution policies?
Can we do Min Replication load balancing? Also is it a statement level load balancing or connection level load balancing?

@flike
Copy link
Owner

flike commented Sep 11, 2015

You can use multi nodes(one master and multi slaves) to hold the data.
kingshard is statement level load balancing.
For example:
you can set the 'slave' item in config file like this: slave : 192.168.0.11@2,192.168.0.12@3.
kingshard will send two read sqls to 192.168.0.11, and send three read sqls to 192.168.0.12

@pm-kartik-sura
Copy link
Author

Can we add a functionality where the slave is selected which has the min replication lag? I can contribute too.

@flike
Copy link
Owner

flike commented Sep 11, 2015

yeah, welcome to contribute kingshard. But I think this function will make the load balancing disabled.

@pm-kartik-sura
Copy link
Author

Yes you are correct. But its a real life usecase in production. We could have a policy that says:
Select the nodes with min replication lag. If there are multiple nodes, then load balance evenly/load factor.

@flike
Copy link
Owner

flike commented Sep 11, 2015

en, I understand what you say. maybe this is another load banlancing policy of kingshard. You can contribute it in you branch, if many other users consider this function is very useful, I will merge it in the master branch. :)

@pm-kartik-sura
Copy link
Author

:)

@flike flike closed this as completed Oct 10, 2015
@flike flike added the supported label Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants