前言

CAP理论时长会在面试中遇到,在中文互联网很难找到解释得很清楚的,于是在英文的维基百科上找到关于CAP理论的具体解释,我认为其解释得比较清楚,阅读过程中产生了本篇译文.
翻译形式为机翻+本人的理解,抛砖引玉,欢迎大家提出宝贵的意见和建议.

正文

CAP theorem

In theoretical computer science, the CAP theorem, also named Brewer’s theorem after computer scientist Eric Brewer, states that any distributed data store can only provide two of the following three guarantees:

  • Consistency:
    Every read receives the most recent write or an error.
  • Availability:
    Every request receives a (non-error) response, without the guarantee that it contains the most recent write.
  • Partition tolerance
    The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes.

CAP定理

在计算机理论中,CAP理论(计算机科学家Eric Brewer提出,所以也叫做Brewer’s理论),任何分布式存储系统只能如下三个保证中的两个:

  • 一致性
    每次读取能收到最近的写入或者错误.
  • 可用性
    每一次请求都能收到一个(非错误)返回,但不能保证包含最近的写入.
  • 分区容错
    尽管多个节点通过网络丢弃(或延迟)了任意个消息,系统也能够继续运行.

When a network partition failure happens, it must be decided whether to

  • cancel the operation and thus decrease the availability but ensure consistency or to
  • proceed with the operation and thus provide availability but risk inconsistency.

当网络分区发生错误,它必须做出决定:

  • 取消操作确保一致性但因此降低可用性
  • 继续操作确保可用性但有不一致的风险

Thus, if there is a network partition, one has to choose between consistency and availability. Note that consistency as defined in the CAP theorem is quite different from the consistency guaranteed in ACID database transactions

因此,作为一个网络分区必须在一致性和可用性之间做出选择.注意:CAP定理中的一致性定义与ACID数据库事务中的一致性保定有着很大的不同.

Eric Brewer argues that the often-used “two out of three” concept can be somewhat misleading because system designers only need to sacrifice consistency or availability in the presence of partitions, but that in many systems partitions are rare.

Eric Brewer 认为,经常被提及的"三分之二"概念可能会产生误导,因为系统设计师们只需要在存在分区时牺牲一致性或可用性,但是很多系统中分区是很少见的.

Explanation

No distributed system is safe from network failures, thus network partitioning generally has to be tolerated. In the presence of a partition, one is then left with two options: consistency or availability. When choosing consistency over availability, the system will return an error or a time out if particular information cannot be guaranteed to be up to date due to network partitioning. When choosing availability over consistency, the system will always process the query and try to return the most recent available version of the information, even if it cannot guarantee it is up to date due to network partitioning.
 
In the absence of a partition, both availability and consistency can be satisfied.
 
Database systems designed with traditional ACID guarantees in mind such as RDBMS choose consistency over availability, whereas systems designed around the BASE philosophy, common in the NoSQL movement for example, choose availability over consistency.

解释

分布式系统都面临着网络故障的风险,所以网络分区通常都要容忍.在分区存在的情况下,只剩下两个选项:一致性或者可用性.

  • 当选择一致性比可用性更重要时,如果网络分区无法保证特定信息是最新的.将返回一个错误或者超时.
  • 当先择可用性比一致性更重要时,系统将总是处理这次查询并尝试返回近期可用的版本,即便网络分区无法保证信息是最新的.

在没有分区的情况下,一致性和可用性都能到很好的保证.

按照传统ACID原则是的的数据库系统(如RDBMS)选择一致性比可用性更重要,然而,围绕BASE哲学的系统(例如NoSQL系统)选择了可用性比一致性更重要.

History

According to University of California, Berkeley computer scientist Eric Brewer, the theorem first appeared in autumn 1998. It was published as the CAP principle in 1999 and presented as a conjecture by Brewer at the 2000 Symposium on Principles of Distributed Computing (PODC). In 2002, Seth Gilbert and Nancy Lynch of MIT published a formal proof of Brewer’s conjecture, rendering it a theorem.
 
In 2012, Brewer clarified some of his positions, including why the often-used “two out of three” concept can be somewhat misleading because system designers only need to sacrifice consistency or availability in the presence of partitions; partition management and recovery techniques exist. Brewer also noted the different definition of consistency used in the CAP theorem relative to the definition used in ACID.
 
A similar theorem stating the trade-off between consistency and availability in distributed systems was published by Birman and Friedman in 1996. Birman and Friedman’s result restricted this lower bound to non-commuting operations.
 
The PACELC theorem, introduced in 2010,[9] builds on CAP by stating that even in the absence of partitioning, there is another trade-off between latency and consistency.
 
Blockchain technology sacrifices immediate consistency for availability and partition tolerance, by requiring a specific number of “confirmations”, Blockchain consensus algorithms are basically reduced to eventual consistency.

历史

根据加州大学伯克利分校计算机科学家 Eric Brewer 的说法,该定理于 1998 年秋季首次出现。 它于 1999 年作为 CAP 原理发表,并作为 Brewer 在 2000 年分布式计算原理研讨会 (PODC) 上的一个猜想提出。 2002 年,麻省理工学院的赛斯吉尔伯特和南希林奇发表了布鲁尔猜想的正式证明,将其变成了一个定理

2012 年,Brewer 澄清了他的一些立场,包括为什么经常使用的“三分之二”概念可能会有些误导,因为系统设计人员只需要在存在分区的情况下牺牲一致性或可用性;存在分区管理和恢复技术。 Brewer 还注意到 CAP 定理中使用的一致性定义与 ACID 中使用的定义不同。

Birman 和 Friedman 在 1996 年发表了一个类似的定理,说明了分布式系统中一致性和可用性之间的权衡。 Birman 和 Friedman 的结果将这个下限限制为非通勤操作。

2010 年引入的 PACELC 定理建立在 CAP 的基础上,指出即使在没有分区的情况下,延迟和一致性之间也存在另一种权衡。

区块链技术为了可用性和分区容错牺牲了即时一致性,通过要求特定数量的“确认”,区块链共识算法基本上被简化为最终一致性。

CAP理论维基百科翻译相关推荐

  1. java mavlink_MAVLink笔记 #01# 维基百科翻译

    本文内容来源于维基百科,仅供学习参考. MAVLink(Micro Air Vehicle Link)是一种用于与小型无人机通信的协议.它被设计为一个header-only消息封送处理库.MAVLin ...

  2. IEEE 754标准--维基百科

    IEEE二进制浮点数算术标准(IEEE 754) 是20世纪80年代以来最广泛使用的浮点数运算标准,为许多CPU与浮点运算器所采用.这个标准定义了表示浮点数的格式(包括负零-0)与反常值(denorm ...

  3. 维基百科联手谷歌翻译,结果“惨不忍睹”!

    作者 | 琥珀 出品 | AI科技大本营 作为前沿科技新闻报道的一线工作者,我们经常会碰到各种陌生难懂.语言不通的词句. 这直接导致我们在引用和查找信息时,往往辅助以维基百科和谷歌翻译为代表的两大信息 ...

  4. Python实现“维基百科六度分隔理论“之基础爬虫

    预备阅读:Python的urllib高级用法  Python中Beautiful Soup的用法  Python中的正则表达式模块re 前言 前面学习了urllib和beautifulsoup来进行数 ...

  5. [翻译]Linter简介-摘自维基百科

    最近在看台湾大牛高焕堂的"GoogleAndroid应用软体框架设计"看到设计c组件时发现用到前苏联开发的Linter数据库管理系统.听着感觉蛮牛X.google了一下. 下面是对 ...

  6. Gensim官方教程翻译(五)——英文维基百科的实验

    仅供个人学习之用,如有错误,敬请指正.原文地址 为了测试gensim的性能,我们在维基百科英文版上运行了一些实验. 这个页面描述了获取与处理维基百科的过程,以便任何人都能再现这个结果.本教程要求已经正 ...

  7. CAP理论与MongoDB一致性、可用性的一些思考

    大约在五六年前,第一次接触到了当时已经是hot topic的NoSql.不过那个时候学的用的都是mysql,Nosql对于我而言还是新事物,并没有真正使用,只是不明觉厉.但是印象深刻的是这么一张图片( ...

  8. 一文带你重新审视CAP理论与分布式系统设计

    这是一篇来自微信公众号的文章,如果图片看不到,可直接跳转到文章出处查看:https://mp.weixin.qq.com/s?__biz=MzI4NTA1MDEwNg==&mid=265076 ...

  9. CAP理论为什么不能同时满足

    1. CAP理论介绍 CAP定理(CAP theorem):对于一个分布式计算系统来说,不可能同时满足以下三点: 一致性(Consistency) (等同于所有节点访问同一份最新的数据副本) 可用性( ...

  10. 基于维基百科的用户意图分类

    关于"用户查询意图分类(识别)",在很久以前就开始关注了,最近开始阅读一些文章.前期得文章中,多半在特征抽取中,提到的都是用其他得资源比如查询日志比较多.今天偶然读了一篇文章,以一 ...

最新文章

  1. OBS源代码阅读笔记
  2. 当人类与「熵」对抗时,意识出现了!那AI呢?
  3. jsonSuggest插件如何在使用前激活
  4. ArcGIS Server开发示例诠释
  5. test.php创建,基于phpstudy简单快速搭建一个php程序
  6. 《微软的梦工场》 笔记(1)
  7. react 开发知识准备
  8. Asp.Net Core + Docker 搭建
  9. 计算机语言学考研科目,语言学考研笔记整理(共16页)
  10. flash php socket通信_php socket通信机制实例说明
  11. Vector:动态数组的使用和说明
  12. 【正则表达式】JavaScript的exec()和search()方法
  13. java并发初探ConcurrentHashMap
  14. 史上最快AI计算机发布!谷歌TPU V3的1/5功耗、1/30体积,首台实体机已交付
  15. Linux平台升级chrome浏览器后,再打开会提示:“您的个人资料来自新版 Google Chrome 浏览器,因此无法使用。某些功能可能无法使用。请指定其他个人资料目录,或使用新版本”
  16. 【微服务】使用yml格式进行nacos拓展配置
  17. 三国战纪2 ,西游2的FBA 移植攻略!
  18. Tc wintc turbo c 写的有关图形的小程序 tc图形程序 带按键处理
  19. 国防科大计算机学院贾焰,博士群体竞风流——记国防科大教员队伍的变化
  20. php seekdir,perl 模式匹配总结和shell命令调用方法 (zz)

热门文章

  1. 九度oj 题目1029:魔咒词典
  2. Centos 6版本Device eth0 does not seem to be present,delaying initialization.故障处理
  3. 如何测试扫码支付二维码?
  4. 酒店宾馆wifi无线上网认证,手机认证方式详解
  5. 方程检验格式图片_eviews的异方差检验ppt课件
  6. 设置Parallels Desktop中的虚拟机使用宿主机代理
  7. 晶体管放大电路基础——共射放大电路分析
  8. java根据word模板导出_Java通过word模板导出word
  9. 淘宝APP用户行为数据分析案例——Python
  10. 【神经网络】单层感知器