CAP Theorem

The CAP theorem is a fundamental principle in distributed systems design that states a system can simultaneously provide only two out of the following three guarantees:

  1. Consistency (C): Every read receives the most recent write or an error. In other words, all nodes see the same data at the same time.
  2. Availability (A): Every request receives a response, without guarantee that it contains the most recent write.
  3. Partition Tolerance (P): The system continues to operate despite arbitrary partitioning due to network failures, meaning the system can handle a loss of communication between nodes.