通过分表实现数据库冗余
我们希望通过在服务器集群上水平分片表来实现负载平衡。如果服务器发生故障,有哪些选项可以实现实时冗余?
执行 (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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实现负载平衡和故障安全的最常见方法是拥有一台主服务器和至少一个或多个从服务器。
在您的应用程序中,您有一个仅用于写入的连接,该连接始终使用主设备,而用于读取的连接则使用其中一个从设备。 (这可以使用 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)