10分鐘了解分散式CAP、BASE理論

  • 2019 年 10 月 3 日
  • 筆記

CAP??

2000?7??Eric Brewer????CAP???2???Seth Gilbert?Nancy Lynch???????CAP????CAP??????????????????? CAP???????????????????????????????????????????????????? CAP?C ?Consistency?????A??Availability????P??Partition Tolerance??????

??????????????????

  • ?????G1?G2
  • ???????????
  • ???????????????? 

Consistency?????

Gilbert and Lynch ????????.

any read operation that begins after a write operation completes must return that value, or the result of a later write operation

??????????????????????

????G1?????????????????v0 ??v1????????????G1????????G2??;

  • ?G1???????????????V1?????????? 

  • ?G2??????????G1?G2??????

  1. ?????? ?????????v1?????????? 

  2. ?????????G2??v0??????????

?Partition Tolerance?????

Gilbert and Lynch ?????????.

the network will be allowed to lose arbitrarily many messages sent from one node to another

??????????????????????????

?????????????????????????????????????????????????????????? A?C?????????????????????????

?Availability????

Gilbert and Lynch ? availability?????. every request received by a non-failing node in the system must result in a response ?????????????????????? ??????????????????????????????????????????

????CAP??????

???????????????????p??????????c?a??????????????????

????????????G1????????????????G2???G2????????????????????

?? ?????????????????????????????

??

??????????????????????AP???????????????????????????A?P?????C????????BASE??

BASE ??

eBay????Dan Pritchett??????????????????ACM???????BASE???BASE????CAP??????????????????????StrongConsistency?CAP????????????????????????????????Eventual Consitency??

?Basically Available?????

????????????????????????????????

?Soft State????

?????????????????????????????????????????????CAP???????????

?Eventually Consistent??????

???????????????????????????????????????????????????????????????????????????????????????????????????

??

CAP???????????BASE?CAP???AP????????C????????????????????

??

?????https://mwhittaker.github.io/blog/an_illustrated_proof_of_the_cap_theorem/

CAP ????????”??”???https://www.infoq.cn/article/cap-twelve-years-later-how-the-rules-have-changed

CAP ??????http://www.ruanyifeng.com/blog/2018/07/cap.html

???????PDF