distributed-systems

Definition

CAP Theorem

The CAP Theorem, also called Brewer’s Theorem, describes the three characteristics a distributed system can deliver:

Principles

Consistency

Consistency means that all clients see the same data at the same time, no matter which node they connect to. For this to happen, whenever data is written to one node, it must be instantly forwarded or replicated to all the other nodes in the system before the write is deemed ‘successful.’

1

Availability

Availability means that any client making a request for data gets a response, even if one or more nodes are down. Another way to state this—all working nodes in the distributed system return a valid response for any request, without exception.

1

Partial Tolerance

A partition is a communications break within a distributed system—a lost or temporarily delayed connection between two nodes. Partition tolerance means that the cluster must continue to work despite any number of communication breakdowns between nodes in the system.

1

Example

It state that a system has no drawback when it is consistent and available. In practice, however, this is impossible for distributed (partition tolerant) systems.

Example: One of two databases which are responsible for the withdrawal of balance of bank accounts is unreachable. The system has two options to handle this situation:

  1. Consistency: Disable withdrawals entirely. This results is higher consistency, but sacrifices the availability.
  2. Availability: Allow withdrawals anyway. This results in higher availability, but sacrifices consistency and potential data inconsistencies.

Footnotes

  1. What Is the CAP Theorem? | IBM 2 3