对于设计分布式系统的架构师来说,CAP 是必须掌握的理论。
Published at
星期三 2024-08-14 7:45:42
Consistency:
Where all nodes see the same data at the same time.
Every read receives the most recent write or an error.
All nodes have access to the same data simultaneously.
Availability:
Which guarantees that every request receives a response about whether it succeeded or failed.
Every request receives a (non-error) response – without guarantee that it contains the most recent write.
A promise that every request receives a response, at minimum whether the request succeeded or failed.
Partition tolerance:
Where the system continues to operate even if any one part of the system is lost or fails.
The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes.
The system will continue to work even if some arbitrary node goes offline or can’t communicate.
总结:在一个分布式系统(指互相连接并共享数据的节点的集合)中,当涉及读写操作时,只能保证一致性(Consistence)、可用性(Availability)、分区容错性(Partition Tolerance)三者中的两个,另外一个必须被牺牲。