Cap TheoremDistributed SystemsSystem Design

CAP Theorem Explained

Understand the fundamental trade-offs in distributed data stores: Consistency, Availability, and Partition Tolerance.

Abstract Algorithms

Abstract Algorithms

Jul 2, 2026Β·1 min readΒ·Intermediate
⚑

Quick Take

The CAP Theorem states that a distributed system can guarantee at most two out of three characteristics: Consistency, Availability, and Partition Tolerance. πŸ“Š The CAP Triangle [C] Consisten

The CAP Theorem states that a distributed system can guarantee at most two out of three characteristics: Consistency, Availability, and Partition Tolerance.

πŸ“Š The CAP Triangle

          [C] Consistency
             /       \
            /         \
           /   Network \
          /   Partition \
         /               \
  [A] Availability ───── [P] Partition Tolerance
  • Consistency (C): Every read receives the most recent write or an error.
  • Availability (A): Every non-failing node returns a non-error response (without guarantee that it contains the most recent write).
  • Partition Tolerance (P): The system continues to operate despite arbitrary message loss or delay.

βš–οΈ The Hard Choice: CP vs AP

In the real world, networks will partition (messages will drop). Therefore, you must choose:

  1. CP (Consistency + Partition Tolerance): Reject requests or block to preserve consistency.
  2. AP (Availability + Partition Tolerance): Accept writes on any node, returning stale data on read but keeping the system available.

AI-generated article quiz

Test your understanding

🧠

Ready to test what you just learned?

Generate four focused questions from this article. Answers include immediate explanations.

Reader feedback

Was this article useful?

Rate it if it helped, then continue with the next deep dive when you are ready.

Sign in to save your rating.