MySqlConnector
MySqlConnector copied to clipboard
Automatically remove servers from load balancing pool
I think MySqlConnector, since it already provides load balancing feature, should also handle connection failures to the server and kick out hosts (for period of time) that are unable to connect to the host after X retries. Shouldn't be that much work.
Originally posted by @kostebudinoski in https://github.com/mysql-net/MySqlConnector/issues/226#issuecomment-614619882
I would also be interested in this feature. We are using MySqlConnector with the "least connection" option to connect to a 5 node Galera cluster. Today one of the nodes stopped working and we turned it off, but our applications kept trying to connect to it. So we had to re-deploy about 10 applications with a new connection string.
Any updates about this enhancement? :D +1
Hii @bgrainger, our team would also be interested in this feature. This feature is very important for us, since we are using multiple slave for our read. Right now we need to use ProxySQL to handle this, but it would be really great if the driver can handle everything already like built in load balancing, and splitting of read and writes respectively to slave and master, Just like the MongoDB C# Driver. By implementing this kind of feature, there would be no need to use ProxySQL.
I'm concerned that this "simple feature" will actually lead to reproducing a large amount of ProxySQL (a huge and active project, with over twice the commits of MySqlConnector) inside this library.
While I see the advantages of handling load balancing directly inside MySqlConnector (because the MySQL protocol has issues that make it hard to load-balance correctly), I think it does make sense to use ProxySQL for any non-trivial scenarios, instead of recreating that project here.
Just curious: does your team pay for any ProxySQL Support? Would you pay for any MySqlConnector support if it were offered?
@bgrainger you don't need to adopt the entire ProxySQL feature inside this library, the ideal would be like the MongoDB C# Driver, whereas:
- the driver can auto detect unhealthy server / host (remove them from pooled connections and lists)
- Bring back the unhealthy server / host just in case it is back online
- auto split the read and write, route the write to the master and route the read to the slave (there would be a config like read preference just like in mongoDB Driver, like you can set read from slave or read from master)
- auto detect which server / host is the master and slave so that it can route properly the queries.
We didn't pay for any ProxySQL Support, we would be willing to pay for any MySQLConnector support just in case. This feature would be a game changer for this library, this would be very advantages over the others.