- It is impossible for a distributed system to simultaneously provide more than two of these three guarantees:
CA (Consistent and Available) Systems are not practical
CA (Consistent and Available) key-value systems cannot exist in real world applications. Here’s why:
- Network failure is unavoidable, so a distributed system must tolerate network partition.
- Thus, a system that sacrifices partition tolerance cannot exist in the real world
Demonstrating CP and AP systems
- Assume a data store system with three nodes - , and
- In the ideal world, network partition never occurs. Data written to is automatically replicated to and . Both consistency and availability are achieved (complete CAP system)
- Assume that a partition occurs and goes down and cannot communicate with and .
What will happen in a AP (Available and partition tolerant) system
- In a AP system which values availability over consistency, we would have stale data and the system will continue to accept read requests
- Data written to will not propagate to and
- Data written to or will not propagate to
What will happen in a CP (Consistent and Partition tolerant) system
- If we choose a CP system, which values consistency over availability, we must block all write operations to and to avoid data inconsistency among these 3 servers.
- Perhaps, this is the reason that bank systems are often down - because they cannot afford inconsistent data.