写点什么

Week 6 作業

发布于: 2020 年 11 月 01 日

作業一(至少完成一項):

1 請簡述 CAP 原理。(Chosen)

2 針對 Doris 案例,請用 UML 時序圖描述 Doris 臨時失效的處理過程(包括判斷系統進入臨時失效狀態,臨時失效中的讀寫過程,失效恢復過程)。 (有時間再做)



1 請簡述 CAP 原理。

發現Wiki的描述挺清楚和全面的,所以就節錄Wiki的內容回答吧:



The CAP theorem states that it is impossible for a distributed data store to simultaneously provide more than two out of the following 3 guarantees:



  • Consistency: Every read receives the most recent write or an error

  • Availability: Every request receives a (non-error) response, without the guarantee that it contains the most recent write

  • Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes



When a network partition failure happens, we should decide to

  • Cancel the operation and thus decrease the availability but ensure consistency

  • Proceed with the operation and thus provide availability but risk inconsistency



The CAP theorem implies that in the presence of a network partition, one has to choose between consistency and availability.



No distributed system is safe from network failures, thus network partitioning generally has to be tolerated. In the presence of a partition, one is then left with two options: consistency or availability. When choosing consistency over availability, the system will return an error or a time out if particular information cannot be guaranteed to be up to date due to network partitioning. When choosing availability over consistency, the system will always process the query and try to return the most recent available version of the information, even if it cannot guarantee it is up to date due to network partitioning.



In the absence of network failure – that is, when the distributed system is running normally – both availability and consistency can be satisfied.



CAP is frequently misunderstood as if one has to choose to abandon one of the three guarantees at all times. In fact, the choice is really between consistency and availability only when a network partition or failure happens; at all other times, no trade-off has to be made.



Database systems designed with traditional ACID guarantees in mind such as RDBMS choose consistency over availability, whereas systems designed around the BASE philosophy, common in the NoSQL movement, for example, choose availability over consistency.



The PACELC theorem builds on CAP by stating that even in the absence of partitioning, another trade-off between latency and consistency occurs.



发布于: 2020 年 11 月 01 日阅读数: 32
用户头像

Christy | Software Engineer 2020.03.19 加入

Github : https://github.com/christypacc21

评论

发布
暂无评论
Week 6 作業