当前位置:网站首页>CAP的理解
CAP的理解
2022-07-27 22:27:00 【橘子ꦿ.๓】
1.CAP定理:
指的是在一个分布式系统中,Consistency(一致性)、Availability(可用性)、Partition tolerance(分区容错性),三者不可同时获得
一致性(c):所有节点都可以访问到最新数据
可用性(A):每个请求都可以得到响应的,不管请求是成功还是失败
分区容错性(P):除了全部整体网络故障,其他故障都不能导致整个系统不可用
2.CAP理论就是说在分布式存储系统中,最多只能实现上面的俩点。而由于当前的网络硬件肯定会出现延迟丢包等问题,所以分区容忍性是我们必须需要实现的,所以我们只能在一致性和可用性之间进行权衡
CA: 如果不要求P(不允许分区),则C(强一致性)和A(可用性)是可以保证的。但放弃P的同时也就意味着放弃了系统的扩展性,也就是分布式节点受限,没办法部署子节点,这是违背分布式系统设计的初衷的
CP: 如果不要求A(可用),每个请求都需要在服务器之间保持强一致,而P(分区)会导致同步时间无限延长(也就是等待数据同步完才能正常访问服务),一旦发生网络故障或者消息丢失等情况,就要牺牲用户的体验,等待所有数据全部一致了之后再让用户访问系统
AP:要高可用并允许分区,则需放弃一致性。一旦分区发生,节点之间可能会失去联系,为了高可用,每个节点只能用本地数据提供服务,而这样会导致全局数据的不一致性。
边栏推荐
- How does JMeter solve the problem of garbled code?
- R language uses ggplot2 visualization: use ggpattern package to add custom stripe patterns, shadows, stripes, or other patterns or textures to the grouped bar graph
- Network device hard core technology insider firewall and security gateway (IX) virtualization artifact (II)
- Postman下载、使用教程
- Redis transaction and optimistic lock
- When Jerry made a phone call, recording to SD card /u disk was not enough [article]
- Jerry Zhi has problems in real-time adjustment of sound change effect in magic sound mode [chapter]
- 共创文旅新篇章|新起典与国华文旅签订战略合作协议
- Jerry, if you turn on Bluetooth again, one for two. When the mobile phone is connected to the prototype, it will appear and cannot be connected [chapter]
- At least 42 employees are infected with novel coronavirus! Nokia announces closure of telecom equipment plant in India
猜你喜欢

iperf安装与使用

What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention

Branch and loop sentence exercises

Data visualization - White Snake 2: black snake robbery (3)

接口测试实战项目02:读懂接口测试文档,上手操练

Database daily question --- day 22: last login

深度刨析数据在内存中的存储

startUMl

Read cmake in one article

网络安全漏洞分析与漏洞复现
随机推荐
福特SUV版“野马”正式下线,安全、舒适一个不落
Basic operations of MySQL database (3) --- Based on fields
110. SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe
leetcode:1997. 访问完所有房间的第一天【跳跃dp】
分支和循环语句题目练习
The most detailed summary of common English terms in the chip industry (quick grasp of graphics and text)
Network equipment hard core technology insider firewall and security gateway (11) secrets of zero contact office
LeetCode - 寻找两个正序数组的中位数
【OpenCV 例程 300篇】241. 尺度不变特征变换(SIFT)
深度刨析数据在内存中的存储
Jerry caused other messages to accumulate in the message pool [article]
Can TSMC Samsung build a production line without American equipment for Huawei?
How to smoothly go online after MySQL table splitting?
SRv6初登场
Jerry caused other messages to accumulate in the message pool [article]
Multithreading and multithreaded programming
至少42名员工感染新冠病毒!诺基亚宣布关闭印度电信设备工厂
Current situation of semiconductor testing equipment Market: the localization rate is still less than 10%!
Red team killer behinder_ V4.0 (ice scorpion 4.0)
Read cmake in one article