通过分表实现数据库冗余

发布于 2024-08-27 05:50:39 字数 145 浏览 4 评论 0原文

我们希望通过在服务器集群上水平分片表来实现负载平衡。如果服务器发生故障,有哪些选项可以实现实时冗余?

执行 (2) 次插入而不是一次插入是否有效?一个插入到目标分片,另一个插入到如果主分片不响应则可以访问的辅助分片?或者有更好的方法吗?

谢谢。

We're looking to implement load balancing by horizontally sharding our tables across a cluster of servers. What are some options to implement live redundancy should a server fail?

Would it be effective to do (2) INSERTS instead of one ... one to the target shard, and another to a secondary shard which could be accessed should the primary shard not respond? Or is there a better way?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

捶死心动 2024-09-03 05:50:39

实现负载平衡和故障安全的最常见方法是拥有一台主服务器和至少一个或多个从服务器。

在您的应用程序中,您有一个仅用于写入的连接,该连接始终使用主设备,而用于读取的连接则使用其中一个从设备。 (这可以使用 heartbeat 和 ldirectord 等进行自动负载平衡。

现在的单点故障将是主服务器,您应该为此拥有热备用服务器。(DRBD 和 heartbeat 是满足此类需求的良好组合)

the most common approach to achieve load-balancing and fail-safe is to have a master server and at least one or more slave servers.

in your application you have a connection only for writing which always use the master, and for reading uses one of the slaves. (this can be autloadbalenced with for example heartbeat and ldirectord.

Your single point of failure now would be the master server, for which you should have a hot-standby. (DRBD and heartbeat are a good team for such needs)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文