Standalone conceptTheoremChapter II · Distribution · Building block 7 of 11

CAP Theorem

Communication failures force a choice between availability and strong consistency.

  1. PartitionPartition: Communication break between nodes.
  2. ConsistencyConsistency: Linearizable view of successful operations.
  3. AvailabilityAvailability: Every request to a non-failing node receives a response.

Context

Why this is important

Reason about response choices during a partition.

Reason about response choices during a partition.

Shop example · Mapping

CAP Theorem: inspect the decision

The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. The shop replicates stock availability across two sites. A partition separates them while customers request reservations. The team decides that a site rejects reservations without coordination to avoid double allocation; the product catalogue may temporarily show older availability. This different response follows the business risk of each operation. A CAP diagram does not replace a precise consistency guarantee and failure model.

This is how you read the picture

  1. Partition Partition
  2. Consistency Consistency
  3. Availability Availability
CAP Theorem: inspect the decision
ConceptMeaningReview question
PartitionCommunication break between nodes.How does the shop respond during the replication partition?
ConsistencyLinearizable view of successful operations.Which guarantee is prioritized for reservations?
AvailabilityEvery request to a non-failing node receives a response.Which case does CAP address?
Die Wahl betrifft die Antworten während des Kommunikationsbruchs: Einige Operationen warten oder scheitern, damit Konsistenz erhalten bleibt; andere antworten weiter und akzeptieren mögliche Divergenz. CAP ist keine allgemeine Dreierauswahl für Systeme ohne Partition und keine Aussage über Skalierbarkeit. Use the questions in the second column to test this scenario.

Benefits & limitations

Helps if:

  • Reason about response choices during a partition.
  • Specify consistency guarantees and response behavior for each operation.

Boundaries

  • CAP concerns partitions and precisely defined guarantees.
  • The choice depends on the operation and partition; CAP does not explain blanket availability during normal operation.

In practice

  1. Separate the expected responses for catalogue display and authoritative stock reservation during a network partition; state availability and consistency for each operation.
  2. Describe what response the shop can return from a disconnected replica and whether a successful reservation requires a linearizable confirmation.
  3. Test the chosen policy for both operations during partition and recovery, and document how divergent stock counts are reconciled.
Read the detailed explanation

CAP describes a constraint on distributed data: during a network partition, a service cannot guarantee both linearizable consistency and availability for every request. Partition tolerance is an operating assumption for distributed systems, not a freely optional property.

The choice concerns responses during communication failure: some operations wait or fail to preserve consistency; others continue to answer and accept possible divergence. CAP is not a general three-way choice for systems without partitions and says nothing about scalability.

The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. The shop replicates stock availability across two sites. A partition separates them while customers request reservations. The team decides that a site rejects reservations without coordination to avoid double allocation; the product catalogue may temporarily show older availability. This different response follows the business risk of each operation. A CAP diagram does not replace a precise consistency guarantee and failure model. cap and pacelc help compare this decision with adjacent concerns.

Check your understanding

Test yourself in three stages

  1. ReadingCheck in the picture

    How does the shop respond during the replication partition?

    View the solution with justification

    Reservations are rejected while the catalogue remains readable.

  2. ApplyingTransferred to a new situation

    Which guarantee is prioritized for reservations?

    View the solution with justification

    Consistency for valid reservations over availability of every write.

  3. EvaluateWeighing an alternative

    Which case does CAP address?

    View the solution with justification

    Behavior during a network partition and precisely defined guarantees.

Continue on the learning path

Next in Distributed systems: Quorum.

11 Building blocks

Continue withQuorum