当前位置:网站首页>Cap and base theory
Cap and base theory
2022-07-03 20:06:00 【lyzchengxuyuan】
- CAP theory
2000 year 7 month , University of California, Berkeley Eric Brewer Professor at ACM PODC Proposed at the meeting CAP guess .2 After year , MIT's Seth Gilbert and Nancy Lynch It is proved theoretically CAP. after ,CAP Theory has become an accepted theorem in the field of distributed computing .
CAP The theory is : A distributed system can only satisfy the consistency at most (Consistency)、 Usability (Availability) And partition fault tolerance (Partition tolerance) Two of these three .
1.1 Uniformity (Consistency)
Consistency means “all nodes see the same data at the same time”, That is, after the update operation succeeds and returns to the client , All nodes have the same data at the same time .
1.2 Usability (Availability)
Usability means “Reads and writes always succeed”, That is, the service is always available , And it's normal response time .
1.3 Partition tolerance (Partition tolerance)
Partition fault tolerance means “the system continues to operate despite arbitrary message loss or failure of part of the system”, That is, when the distributed system encounters a node or network partition failure , Still able to provide external services to meet the consistency and availability .
- CAP Balance
adopt CAP theory , We know that consistency cannot be met at the same time 、 Availability and partition fault tolerance , Which one should I give up ?
For most large Internet application scenarios , There are many hosts 、 Deployment is decentralized , And now the scale of the cluster is growing , So node failure 、 Network failure is the norm , And make sure the service availability reaches N individual 9, Guarantee P and A, Abandon C( Second, to ensure the final consistency ). Although some places can affect the customer experience , But it didn't reach the level that caused the user process .
There can't be a little concession when it comes to money ,C Must ensure . In case of network failure, it's better to stop service , This is a guarantee CA, Abandon P. It seems that in recent years, the domestic banking industry has been on the rise 10 There was an accident , But it doesn't matter , There's not much reporting , The masses know little . There is also a guarantee CP, Abandon A. For example, if there is a network fault, it is read-only and not written .
Which is better, which is less , No conclusion , It can only be decided according to the scene , What suits is the best .
- BASE theory
eBay Architect Dan Pritchett From the practice summary of large-scale distributed system , stay ACM Put forward in an article published on BASE theory ,BASE The theory is right CAP The extension of theory , The core idea is that even if strong consistency cannot be achieved (Strong Consistency,CAP Consistency is strong consistency ), But the application can achieve final consistency in a suitable way (Eventual Consitency).
BASE Basically available (Basically Available)、 Soft state ( Soft State)、 Final consistency ( Eventual Consistency).
3.1 Basic available (Basically Available)
Basic availability refers to the failure of distributed system , Partial loss of availability is allowed , That is to ensure that the core is available .
When e-commerce is booming , In response to the surge in traffic , Some users may be directed to the degraded page , The service layer may only provide degraded Services . This is the loss of some availability .
3.2 Soft state ( Soft State)
Soft state means that the system is allowed to have intermediate state , The intermediate state will not affect the overall availability of the system . In distributed storage, there are at least three copies of a data , The delay that allows the replica synchronization between different nodes is the embodiment of the soft state .mysql replication Asynchronous replication is also a manifestation of .
3.3 Final consistency ( Eventual Consistency)
Final consistency means that after a certain period of time, all data copies in the system , In the end, we can reach a consistent state . Weak consistency is the opposite of strong consistency , Final consistency is a special case of weak consistency .
4. ACID and BASE The difference and connection
ACID It is a common design concept of traditional database , The pursuit of a strong consistency model .BASE It supports large distributed systems , High availability is achieved by sacrificing strong consistency .
ACID and BASE Represents two completely opposite design philosophy
In the scenario of distributed system design , System components have different requirements for consistency , therefore ACID and BASE It will be used in combination with .
边栏推荐
- Chapter 1: seek common? Decimal and S (D, n)
- Bright purple crystal meso tetra (4-aminophenyl) porphyrin tapp/tapppt/tappco/tappcd/tappzn/tapppd/tappcu/tappni/tappfe/tappmn metal complex - supplied by Qiyue
- Nerfplusplus parameter format sorting
- Sword finger offer 30 Stack containing min function
- 10 smart contract developer tools that miss and lose
- Initialization and instantiation
- BOC protected tryptophan zinc porphyrin (Zn · TAPP Trp BOC) / copper porphyrin (Cu · TAPP Trp BOC) / cobalt porphyrin (cobalt · TAPP Trp BOC) / iron porphyrin (Fe · TAPP Trp BOC) / Qiyue supply
- Implementation of stack
- Global and Chinese market of high purity copper foil 2022-2028: Research Report on technology, participants, trends, market size and share
- Promethus
猜你喜欢
Chapter 1: sum of three factorials, graph point scanning
2022-07-02 网工进阶(十五)路由策略-Route-Policy特性、策略路由(Policy-Based Routing)、MQC(模块化QoS命令行)
Professional interpretation | how to become an SQL developer
Chapter 1: extend the same code decimal sum s (D, n)
2022-06-27 网工进阶(十二)IS-IS-开销类型、开销计算、LSP的处理机制、路由撤销、路由渗透
Meso tetra [P - (p-n-carbazole benzylidene imino)] phenylporphyrin (tcipp) /eu (tcipp) [pc( α- 2-oc8h17) 4] and euh (tcipp) [pc (a-2-oc8h17) 4] supplied by Qiyue
Teach you how to quickly recover data by deleting recycle bin files by mistake
Nerfplusplus parameter format sorting
原生表格-滚动-合并功能
Chapter 1: find the algebraic sum of odd factors, find the same decimal sum s (D, n), simplify the same code decimal sum s (D, n), expand the same code decimal sum s (D, n)
随机推荐
kubernetes集群搭建efk日志收集平台
Microservice framework - frequently asked questions
1.5 learn to find mistakes first
2022-06-25 网工进阶(十一)IS-IS-三大表(邻居表、路由表、链路状态数据库表)、LSP、CSNP、PSNP、LSP的同步过程
Cesiumjs 2022 ^ source code interpretation [7] - Analysis of the request and loading process of 3dfiles
Chapter 1: find the factorial n of n!
Network security Kali penetration learning how to get started with web penetration how to scan based on nmap
Promethus
Class loading process
Global and Chinese markets for medical temperature sensors 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets of cast iron diaphragm valves 2022-2028: Research Report on technology, participants, trends, market size and share
Today's work summary and plan: February 14, 2022
Test access criteria
How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
Sparse matrix (triple) creation, transpose, traversal, addition, subtraction, multiplication. C implementation
4. Data splitting of Flink real-time project
Xctf attack and defense world crypto advanced area best_ rsa
Assign the CMD command execution result to a variable
Rad+xray vulnerability scanning tool
BOC protected tryptophan zinc porphyrin (Zn · TAPP Trp BOC) / copper porphyrin (Cu · TAPP Trp BOC) / cobalt porphyrin (cobalt · TAPP Trp BOC) / iron porphyrin (Fe · TAPP Trp BOC) / Qiyue supply