当前位置:网站首页>Distributed cap theory
Distributed cap theory
2022-07-04 06:05:00 【Zhan sir (open source byte)】
CAP The theory is distributed system 、 In particular, the most discussed theory in the field of distributed storage . among C For consistency (Consistency),A For usability (Availability),P Represents partition fault tolerance (Partition tolerance).CAP Theory tells us C、A、P The three cannot be satisfied at the same time , Only two of them can be satisfied at most .
CAP A brief introduction to the theory
CAP The theory is distributed system 、 In particular, the most discussed theory in the field of distributed storage . among C For consistency (Consistency),A For usability (Availability),P Represents partition fault tolerance (Partition tolerance).CAP Theory tells us C、A、P The three cannot be satisfied at the same time , Only two of them can be satisfied at most .

CAP Two out of three
Uniformity (Consistency): A write operation returns success , Then all subsequent read requests must read this new data ; If the return fails , Then all read operations cannot read this data . All nodes access the same latest data .Usability (Availability): High availability for data updates , Requests can be processed in a timely manner , Not always waiting for , Even if a node fails .Partition tolerance (Partition tolerance): Can tolerate network partition , When the network is disconnected , The separated nodes can still provide services to the outside world .
Yes CAP Theoretical understanding
understand CAP The simplest theory is to imagine two replicas on either side of the partition , That is, the network between the two replicas is disconnected , Can't communicate .
- If one copy is allowed to update , It will lead to inconsistent data , That is, to lose C nature .
- If in order to ensure consistency , Set the replica on one side of the partition to unavailable , So lost again A nature .
- Unless two copies can communicate with each other , To guarantee C And promise A, This in turn leads to the loss of P nature .
Generally speaking, distributed systems using network communication , Can't give up P nature , Then we can only make a difficult choice in terms of consistency and availability .
CAP The expression of theory serves its purpose well , It broadens the thinking of distributed system designers , Design a variety of systems under a variety of alternatives . There have been countless new systems in the past decade , As a result, there have been quite a number of debates on the relative relationship between consistency and usability .
CAP In depth theoretical understanding
stay CAP Twelve years after the theory was put forward , The author came out to refute the rumor .“ Two out of three ” There has always been a misleading formula , It oversimplifies the relationship between properties :
- First , Because zoning rarely happens , So there's no reason to sacrifice when there's no partition in the system C or A.
- secondly ,C And A The trade-offs can occur repeatedly in the same system with very small granularity , And every decision may be made because of specific operation , Even because it involves specific data or users .
- Last , All three properties can be measured in degree , It's not black or white with or without . Usability is obviously in 0% To 100% Between successive changes , There are many levels of consistency , Even zoning can be subdivided into different meanings , For example, different parts of the system can have different cognition about whether there is a partition .
So consistency and usability are not incompatible , Either this or that .Paxos、Raft The equally distributed consistency algorithm is the witness of a good balance between consistency and availability .
If you reprint , Please indicate the source : Open source byte https://sourcebyte.cn/article/176.html
边栏推荐
- Grounding relay dd-1/60
- Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
- Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
- HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
- buuctf-pwn write-ups (8)
- 卸载Google Drive 硬盘-必须退出程序才能卸载
- Steady! Huawei micro certification Huawei cloud computing service practice is stable!
- Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
- [untitled]
- Practical gadget instructions
猜你喜欢

Google Chrome browser will support the function of selecting text translation

Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式

Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)

Weekly summary (*63): about positive energy

BeanFactoryPostProcessor 与 BeanPostProcessor 相关子类概述

Take you to quickly learn how to use qsort and simulate qsort
![[Excel] 数据透视图](/img/45/be87e4428a1d8ef66ef34a63d12fd4.png)
[Excel] 数据透视图

Gridview出现滚动条,组件冲突,如何解决

每周小结(*63):关于正能量

C language - Blue Bridge Cup - Snake filling
随机推荐
4G wireless all network solar hydrological equipment power monitoring system bms110
[microservice] Nacos cluster building and loading file configuration
JS get the attribute values nested in the object
2022.7.3-----leetcode.556
AWT common components, FileDialog file selection box
js获取对象中嵌套的属性值
Design and implementation of tcp/ip series overview
QT qtablewidget table column top requirements ideas and codes
Canoe panel learning video
Invalid revision: 3.18.1-g262b901-dirty
体验碎周报第 102 期(2022.7.4)
2022.7.2-----leetcode. eight hundred and seventy-one
Recommended system 1 --- framework
C language - Blue Bridge Cup - Snake filling
Gridview出现滚动条,组件冲突,如何解决
Arc135 C (the proof is not very clear)
Webrtc quickly set up video call and video conference
Learning multi-level structural information for small organ segmentation
JSON Web Token----JWT和傳統session登錄認證對比
LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout