Why CAP can not have both
Why in the distributed environment CAP can not have both? This question can be done on the board, so that the key to the problem is: Suppose there is a network partition, if you have P, that is, to tolerate the existence of network partition, then C and A can have both. Can be divided into two cases to carry out further deduction. Case 1: If there is no copy of the data in this distributed system, then the system must meet the strong consistency conditions, because only the unique data, there will be no data inconsistencies. At this point C and P elements are available, but if the system has a network partition status or machine downtime, will inevitably lead to some data is not accessible, then the availability conditions can not be met, that is, in this case obtained the CP system, But the CAP can not be met at the same time. Case 2: If there is a copy of the data in the system (see Figure 2-2), assume that the variable x has two copies and is stored on different machines, the ...