本文介绍了为什么将RC定理认为RDBMS可用(CA)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正确理解CAP定理,那么可用性意味着即使节点发生故障,群集也可以继续运行.

我见过很多人( http://blog.nahurst.com/tag/guide )将RDBMS列为CA,但我不了解RBDMS如何可用,就好像节点发生故障时,群集也必须中断才能保持一致性.

对此,我唯一可能的答案是,大多数RDBMS是单个节点,因此没有非失败"节点.但是,这似乎是技术上的问题,不是真正的可用性",而且绝对不是高可用性.

谢谢.

解决方案

首先,让我澄清一下并指出,RDBMS中的一致性不同于分布式系统中的一致性. RDBMS(单个系统)将一致性应用于事务一致性,就像在分布式系统中一样,一致性意味着从系统中任何位置(从任何节点读取)的视图都是一致的.因此,就CAP定理而言,无法讨论RDMBS单节点.这就像将苹果与橙子进行比较.

具有主从功能的RDBMS可以与分布式系统进行比较.在这里,RDBMS可以配置为CA/CP或AP.例如,MySQL提供了一种配置系统的方式,即如果仲裁丢失(没有足够的辅助副本用于提交日志复制),则群集不可用(CP系统). MySQL还提供了一种配置,只要主服务器可用(CA系统),群集就可以运行,并且有可能造成数据丢失. SQL Server AlwaysOn是一个AP系统,因为提交日志复制是异步的(即使在同步副本上也是如此).

因此,RDBMS可以是分布式环境中的任何CA,CP或AP.

If I understand the CAP Theorem correctly, availability means that the cluster continues to operate even if a node goes down.

I've seen a lot of people (http://blog.nahurst.com/tag/guide) list RDBMS as CA, but I do not understand how RBDMS is available, as if a node goes down, the cluster must go down to maintain consistency.

My only possible answer to this has been that most RDBMS are a single node, so there is no "non-failing" node. But, this seems to be a technicality, not true 'availability' and definitely not high availability.

Thank you.

解决方案

First of all, let me clarify and state that the consistency in RDBMS is different than consistency in distributed systems. RDBMS (single system) applies consistency to transactional consistency, where as in distributed systems consistency means view from anywhere in the system (read from any node) is consistent. So RDMBS single node cannot be discussed with regards to CAP theorem. It is like comparing apple to orange.

RDBMS with master-slave can be compared to distributed systems. Here RDBMS can be configured to CA/CP or AP. MySQL for example, provides a way to configure the system in a way that if there is a quorum loss (not enough secondary available for commit log replication), the cluster is not available (CP system). MySQL also provides a configuration to allow the cluster to operate as long as master is available (CA system) with the potential of data loss. SQL Server AlwaysOn is an AP system, because commit log replication is asynchronous (even on sync replicas).

So RDBMS can be any of CA, CP or AP in a distributed world.

这篇关于为什么将RC定理认为RDBMS可用(CA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 14:43