CAP定理为什么RDBMS分区不能容忍,为什么可用? [英] Why isn't RDBMS Partition Tolerant in CAP Theorem and why is it Available?

查看:144
本文介绍了CAP定理为什么RDBMS分区不能容忍,为什么可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CAP定理中,关于RDBMS是CA我不了解两点:

Two points I don’t understand about RDBMS being CA in CAP Theorem :

1)它说RDBMS 不是 分区容忍,但是RDBMS的分区容忍度比其他技术(如MongoDB或Cassandra)更弱吗?是否在RDBMS设置中放弃了CA以使其成为AP或CP?

1) It says RDBMS is not Partition Tolerant but how is RDBMS any less Partition Tolerant than other technologies like MongoDB or Cassandra? Is there a RDBMS setup where we give up CA to make it AP or CP?

2)CAP是否可用?是通过主从设置吗?就像主机死时一样,从机接管写操作?

2) How is it CAP-Available? Is it through master-slave setup? As in when the master dies, slave takes over writes?

我是数据库体系结构和CAP定理的新手,请耐心等待.

I’m a novice at DB architecture and CAP theorem so please bear with me.

推荐答案

现在许多数据库实际上具有不同的配置,并且取决于您设置的设置,它可以是CA,CP,AP等,但不能实现全部三个在同一时间.一些数据库实际上在努力支持这三个数据库,但仍以某种方式确定它们的优先级.

A lot of databases now actually have different configurations and depending on the settings you set, it can be either CA, CP, AP, etc but can not achieve all three at the same time. Some databases actually make an effort to support all three but still prioritizes them in a certain way.

例如,根据配置,MySQL可以是CP和CA.默认情况下,它是CA,因为它遵循主从模式,该模式将数据复制到从模式.如果一组从服务器失去与主服务器的连接,则会牺牲分区容限,因此决定选择一个新的主服务器,以创建两个拥有自己的从服务器的主服务器.

For example, MySQL can be CP and CA depending on the configurations. By default, it is CA because it follows a master slave paradigm which data is replicated to the slaves. Partition tolerance is sacrificed in the event that a set of the slaves loses the connection to the master and therefore decides to elect a new master creating two masters with their own set of slaves.

但是,MySQL还具有另一种配置,即集群配置.它优先考虑CP而不是可用性.如果没有足够的活动节点来服务所有数据,群集将关闭.

However, MySQL also has another configuration which is a clustered configuration. It prioritizes CP over availability eg. the cluster will shutdown if there are not enough live nodes to serve all the data.

MySQL可能有更多配置,可以满足其他CAP定理组合,但总的来说,我只想说这取决于您的系统要求.有时候,数据库对于一种配置要比对另一种配置更好,因此最好查看使用某种配置时可能还会出现哪些类型的问题.

There are probably more configurations for MySQL that makes it satisfy other CAP theorem combinations but overall, I just wanted say that it depends on what your system requires. Sometimes databases are better for one configuration vs another so its best to see what kinds of problems that may also occur in using a certain configuration.

关于实施CAP定理,我建议进一步研究不同的数据库,以及它们如何实现CAP定理的优先级.实现它们的方式太多了,例如.通常,主从模型用于CA系统,散列环用于AP系统等.

As for implementing the CAP theorem, I would advise taking a further look into different databases and how they implement the priorities for the CAP theorem. There are just too many different ways of implementing them eg. generally, the master slave model is used for CA systems, the hash ring for AP systems, etc.

这篇关于CAP定理为什么RDBMS分区不能容忍,为什么可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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