MySQL Proxy Alternatives for Database Sharding

夙愿已清 提交于 2019-11-29 10:26:15

问题


Are there any alternatives for MySQL Proxy. I don't want to use it since it's still in alpha.

I will have 10 MySQL servers with table_1 table_2 table_3 table_4 ... table_10 spread across the 10 servers. Each table is identical in their structure, their just shards with different data sets.

Is there a alternative to MySQL Proxy, where I can have my client application connect to a single SQL Server (A proxy), which looks at the query and fetches the data on behalf of it.

For example, if the client requests "SELECT * FROM table_5 WHERE user=123" from the Proxy, which connects to the 5th SQL Server that houses table_5 and gets the data?


回答1:


Spock Proxy supports range-based horizontal paritioning of a large MySQL database. The proxy intercepts SQL queries from the client, sends queries to the correct databases based on how the database is partitioned, then aggregates the results from each database and returns them to the client as a regular MySQL result set.




回答2:


I can see that adding a proxy could enable you to change little or nothing in the app but it's worth considering that you're adding a big single point of failure.

I would suggest that you move the logic required to decide which database to go looking in up into the application layer.



来源:https://stackoverflow.com/questions/810085/mysql-proxy-alternatives-for-database-sharding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!