Skip to main content

System Design Foundations

CAP Theorem & Consistency Models

0:00
LearnStep 1/2

CAP Theorem Explained

CAP Theorem

The CAP theorem states that a distributed system can only provide two of three guarantees simultaneously:

plaintext

The Three Guarantees

  • Consistency (C): Every read receives the most recent write
  • Availability (A): Every request receives a response (success/failure)
  • Partition Tolerance (P): System continues operating despite network partitions

CAP Trade-offs in Practice

typescript

Consistency Models

typescript