本文介绍了CAP定理是红色鲱鱼吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我,我必须放弃大型分布式系统中的交易担保,因为说我不能拥有它。

I am told that I have to give up transactional guarantees in large distributed systems because the CAP theorem says I can't have it.

我认为这是错误的,原因如下:

I think this is wrong for the following reasons:


  • Internet路由是

  • CAP定理仅适用于两组现场计算机无法通信的网络分区。

  • 几乎所有真实的网络分区都由灾难性故障或其中一个分区很小而另一个分区很大而又一个小分区可以关闭的情况。

  • 机器故障本身并不构成网络分区。

  • Internet routing is amazingly reliable.
  • The CAP theorem only applies to network partitions where two groups of live machines can't communicate.
  • Almost all real network partitions consist of catastrophic failures or cases where one of the partitions is very small and the other is very large and the small one can just shut down.
  • Machine failures by themselves do not constitute a network partition.

因此,我可以假设出于实际目的,我可以具有事务性行为,但前提是我试图保证小分区检测到它们已断开连接并关闭或以某种降级模式运行,直到修复连接为止。

Therefore, I can assume that for practical purposes I can have transactional behavior provided I attempt to guarantee that small partitions detect that they are disconnected and shut down or operate in some sort of degraded mode until the connection is repaired.

更正?评论?



参考文献:


  • 有关CAP定理的概述,请参见Julian Browne的这篇文章


  • For an overview of CAP Theorem see this article by Julian Browne here
  • CAP Theorem on wikipedia

推荐答案

CAP定理已由Nancy Lynch等人证明。在麻省理工学院的实验室。

The CAP theorem has been proven by Nancy Lynch et al. at MIT labs.

您的假设不好。是的,您可以在分布式系统上进行事务处理,但随后必须等待所有事务处理。那就是您遭受可用性困扰的时候。因此,您可以具有一致性和部分容忍性,但不能具有可用性。

Your assumptions are not good. Yes, you can have transactions at a distributed system, but then you have to wait for all your transactions. That's when you suffer from availability. So you can have consistency and partial tolerance, but not availability.

在另一种情况下,您可以具有可用性和部分容忍性,但是没有一致性,例如MongoDB或Cassandra (配置了最终的一致性)。在这种情况下,您可以有多个数据库服务器,但是您的数据将无法立即在所有服务器上使用。您会遭受一致性的困扰,但会获得可用性和部分容忍度。

In the other case, you can have availability and partial tolerance, but no consistency, such as MongoDB or Cassandra (with eventual consistency configured). In this case, you can have multiple DB servers, but your your data won't be available across all the servers right away. You suffer from consistency, but you gain with availability and partial tolerance.

最后一种情况是最简单的情况:您具有一致性和可用性,但没有局部容忍度。考虑单个数据库服务器。

The Last case is the easiest one: You have consistency and availability, but no partial tolerance. Think of a single database server.

关于您的观点:

无缝可靠。

CAP定理适用于任何分布式系统。

The CAP theorem applies to any distributed system.

其他两点确实没有太大意义。

The other two points are really not making too much sense.

还有其他一些教授声称CAP是不完整的,而且还有很多,例如延迟。但是CAP定理很有意义。

There are some other professors who claim that CAP is incomplete, and that there is more to it, such as latency. But the CAP theorem makes perfect sense.

还有一个 BASE定理(基本可用,软状态和最终一致性)。许多NoSQL数据库都赞成该定理。

There is also the "BASE" theorem (Basically Available, Soft state, and Eventual consistency). Many NoSQL databases are favoring this theorem.

在和。

这篇关于CAP定理是红色鲱鱼吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 21:21