数据库集群和负载平衡 [英] Database cluster and load balancing

查看:97
本文介绍了数据库集群和负载平衡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是数据库集群?如果您允许同一数据库位于2台不同的服务器上,它们如何保持数据之间的同步.从数据库服务器的角度来看,这与负载平衡有何不同?

What is database clustering? If you allow the same database to be on 2 different servers how do they keep the data between synchronized. And how does this differ from load balancing from a database server perspective?

推荐答案

数据库集群是一个模糊的术语,一些供应商认为具有两个或更多服务器共享同一存储的集群,另一些供应商则称该集群为一组复制的服务器.

Database clustering is a bit of an ambiguous term, some vendors consider a cluster having two or more servers share the same storage, some others call a cluster a set of replicated servers.

复制定义了一种方法,通过该方法,一组服务器可以保持同步而不必共享能够在地理位置上分散的存储,主要有两种处理方法:

Replication defines the method by which a set of servers remain synchronized without having to share the storage being able to be geographically disperse, there are two main ways of going about it:

  • 主-主(或多主)复制:任何服务器都可以更新数据库.通常由数据库中的其他模块(或在某些情况下在它们之上运行的完全不同的软件)来处理.

  • master-master (or multi-master) replication: Any server can update the database. It is usually taken care of by a different module within the database (or a whole different software running on top of them in some cases).

缺点是做起来很难,并且某些系统处于这种复制模式时会丢失ACID属性.

Downside is that it is very hard to do well, and some systems lose ACID properties when in this mode of replication.

上部是它的灵活性,您可以在更新数据库的同时支持任何服务器的故障.

Upside is that it is flexible and you can support the failure of any server while still having the database updated.

主从复制:仅存在权威数据的单个副本,该副本被推送到从属服务器.

master-slave replication: There is only a single copy of authoritative data, which is the pushed to the slave servers.

缺点是容错性较差,如果主机死了,则从机将没有进一步的变化.

Downside is that it is less fault tolerant, if the master dies, there are no further changes in the slaves.

好处是,它比多主机更容易执行,并且通常保留ACID属性.

Upside is that it is easier to do than multi-master and it usually preserve ACID properties.

负载平衡是一个不同的概念,它包括将发送到这些服务器的查询分布到各个服务器,以便负载尽可能均匀地分布.通常,它是在应用程序层(或使用连接池)完成的.复制和负载平衡之间的唯一直接关系是,您需要进行一些复制才能实现负载平衡,否则您将只有一台服务器.

Load balancing is a different concept, it consists distributing the queries sent to those servers so the load is as evenly distributed as possible. It is usually done at the application layer (or with a connection pool). The only direct relation between replication and load balancing is that you need some replication to be able to load balance, else you'd have a single server.

这篇关于数据库集群和负载平衡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆