Sivaram Konanki

February 10, 2025

CAP theorem

During a network partition (P), the CAP theorem states that we must choose between Consistency (C) and Availability (A). 

The fundamental reason is that during a network partition:

  • Some nodes can't communicate with each other
  • Clients may write to different nodes
  • System must have a way to resolve this conflicts

The key conflict is this:

  • To maintain availability (A) you need to accept writes on both sides of network partition, (if there is only one writer, and the writes go down, there is no availability)
  • To maintain consistency (C), the system must ensure all nodes sees the same data
  • These are mutually exclusive

Hence, the system must decide,

  • Either refuse writes on one or both sides of partition (lose availability)
  • Or accept conflicting writes (lose consistency)