数据库分片的 MySQL 代理替代方案
MySQL Proxy 有其他替代方案吗? 我不想使用它,因为它仍处于 alpha 阶段。
我将拥有 10 台 MySQL 服务器,其中 table_1 table_2 table_3 table_4 ... table_10 分布在这 10 台服务器上。 每个表的结构都是相同的,只是具有不同数据集的分片。
有没有 MySQL 代理的替代方案,我可以让我的客户端应用程序连接到单个 SQL Server(代理),该服务器查看查询并代表它获取数据。
例如,如果客户端向代理请求“SELECT * FROM table_5 WHERE user=123”,代理会连接到包含 table_5 的第 5 个 SQL Server 并获取数据?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Spock Proxy 支持大型 MySQL 数据库的基于范围的水平分区。 代理拦截来自客户端的 SQL 查询,根据数据库的分区方式将查询发送到正确的数据库,然后聚合每个数据库的结果并将它们作为常规 MySQL 结果集返回给客户端。
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.
我可以看到,添加代理可以让您在应用程序中进行很少的更改或不进行任何更改,但值得考虑的是您正在添加一个大的单点故障。
我建议您将决定查找哪个数据库所需的逻辑移至应用程序层。
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.