system-design-primer
reference — fundamentals

CAP theorem

in short — written for this site
Pick two. Networks fail, so partition tolerance isn't the one you drop.
CP
Waiting for a response from the partitioned node might result in a timeout. A good choice when business needs require atomic reads and writes — payments, inventory, locks.
AP
Responses return the most readily available version on any node, which might not be the latest. Writes propagate once the partition resolves. A good choice for eventual consistency — feeds, counters, DNS.
in practice
Most systems are neither purely CP nor AP but choose per operation: a checkout is CP, a view counter is AP.
from the primer — full sectionsynced
Source: CAP theorem revisited
Source: CAP theorem revisited

In a distributed computer system, you can only support two of the following guarantees:

  • Consistency - Every read receives the most recent write or an error
  • Availability - Every request receives a response, without guarantee that it contains the most recent version of the information
  • Partition Tolerance - The system continues to operate despite arbitrary partitioning due to network failures

Networks aren't reliable, so you'll need to support partition tolerance. You'll need to make a software tradeoff between consistency and availability.

CP - consistency and partition tolerance

Waiting for a response from the partitioned node might result in a timeout error. CP is a good choice if your business needs require atomic reads and writes.

AP - availability and partition tolerance

Responses return the most readily available version of the data available on any node, which might not be the latest. Writes might take some time to propagate when the partition is resolved.

AP is a good choice if the business needs to allow for eventual consistency or when the system needs to continue working despite external errors.

sourcedonnemartin/system-design-primer / README.mdanchor#cap-theoremsyncedsynced from donnemartin/system-design-primer@master · 2026-08-16