This is a great question about the CAP theorem. Let me provide a rigorous proof sketch and then construct a concrete partition scenario that illustrates the impossibility of having all three properties simultaneously.
CAP Theorem
The CAP theorem (Brewer's theorem) states that a distributed system can satisfy at most 2 of 3 properties:
Consistency (C): All nodes see the same data at the same time
Availability (A): Every request receives a response (success or failure)
Partition tolerance (P): System continues operating despite network partitions
Since P is inevitable in real distributed systems (network failures happen), the practical choice is between CA and one of CP or AP.
Proof Sketch
Let me construct a formal proof sketch:
Setup:
N nodes in a distributed system
A write operation W followed by a read operation R
A network partition occurs that splits the system into two parts: P1 and P2
Theorem Statement:
If a network partition occurs, a distributed system cannot guarantee both Consistency and Availability.
Proof:
Assumptions:
Partition Tolerance (P): By assumption, a partition can occur
Consistency (C): All reads must return the most recent write
Availability (A): All requests must receive a non-error response
The Contradiction:
Consider this scenario:
Write W is executed on node in partition P1 at time t₁
At time t₂ > t₁, partition occurs between P1 and P2
Read R arrives at node in partition P2 at time t₃, where t₂ < t₃
Now we have two choices:
Case 1: Return the new value (Consistency)
Node in P2 must somehow get the value written in P1
But there's no network path (partition exists)
Either:
Wait for partition to heal (violates Availability)
Guess the value (violates Consistency - might be wrong)
Case 2: Return the old value or error (Availability)
Node in P2 responds immediately
But return value is stale (violates Consistency)
Therefore, during a partition, we cannot have both Consistency and Availability. ∎
Write("account_balance", $500) arrives at DC-East
DC-East successfully updates: {account_balance: $500}
T3: Meanwhile, client in DC-West reads
code
Read("account_balance") arrives at DC-West
DC-West sees: {account_balance: $1000}
The Impossible Choice:
Now I'm facing the core dilemma. When the partition splits the system, DC-East has updated its value to 500whileDC−Weststillholds1000. If I prioritize consistency, I must block one of these operations and sacrifice availability. If I allow both to proceed, the read returns stale data and consistency breaks.
DC-West must verify it has the latest write before responding. It attempts to contact DC-East, but the partition prevents communication. Unable to confirm its data is current, DC-West blocks the read request or returns an error.
✅ Consistency maintained (no stale data served)
❌ Availability violated (request not answered timely)
DC-West responds immediately with its local copy without checking DC-East. The read returns 1000eventhoughDC−Easthasalreadyupda500.
❌ Consistency violated (stale data contradicts latest write of $500)
✅ Availability maintained (got a response)
✅ Partition tolerance maintained
Why Both is Impossible:
During a partition, DC-West faces an impossible choice. To be available, it must answer immediately without synchronizing with DC-East. To be consistent, it must know about all writes—but the partition makes that impossible. Waiting for communication violates availability; responding without it violates consistency. There's no way to satisfy both constraints simultaneously when the network is down.
The dilemma:
Any response either takes too long (unavailable) or returns stale data (inconsistent).
Formal Impossibility Proof (by Contradiction)
Suppose all three properties hold during partition P. A write occurs in partition P1, then a read happens later in the disconnected partition P2. By availability, P2 must respond immediately. By consistency, that response must include the write from P1. But since the partitions can't communicate, P2 has no way to learn about the write before responding. This creates a logical contradiction—the system cannot simultaneously answer quickly and accurately when partitioned.
The visual timeline shows this concretely: after the partition forms and a write lands in DC-East, any read at DC-West faces an impossible choice between blocking indefinitely or returning outdated information.
Real systems make different tradeoffs based on their priorities. Cassandra and DynamoDB prioritize availability by accepting temporary inconsistency—they return cached values and reconcile once the partition heals. HBase and Zookeeper instead prioritize consistency by refusing to serve requests when they can't reach quorum. Traditional single-datacenter databases sidestep the problem entirely by assuming partitions won't occur.
CAP Theorem: Proof Sketch & Partition Scenario
Formal Proof Sketch
Theorem Statement
In a partitionable distributed system, a system cannot simultaneously guarantee all three of Consistency, Availability, and Partition-tolerance.
Proof (by impossible scenario)
Setup:
Network partition P splits system into P1 and P2 at time t₀
Write W is committed to P1 at time t₁ > t₀
Read R arrives at P2 at time t₂ > t₁
The Impossibility:
code
P1 (connected to Write) | PARTITION | P2 (receives Read)
W: v ← new_value | | R: v = ?
(can update) | 🔴 | (cannot reach P1)
For the read to return:
Choice
Result
Violated
Return new value immediately
R sees W
Possible? Communication impossible across partition ❌
Wait for healed partition
R sees W
Takes time → Violates Availability ❌
Return stale cached value
R succeeds
But R ≠ W → Violates Consistency ❌
Since partition exists (P is required), you cannot simultaneously choose Consistency AND Availability. ∎
Concrete Partition Scenario: Bank Account
Initial State (All Consistent)
code
Data Center 1 (NYC) Data Center 2 (SF)
┌─────────────────┐ ┌─────────────────┐
│ account_balance │ │ account_balance │
│ $1,000 │◄──────►│ $1,000 │
└─────────────────┘ └─────────────────┘
(replicated) (healthy network) (replicated)
T1: Network Partition (Fiber Cut)
code
Data Center 1 (NYC) Data Center 2 (SF)
┌─────────────────┐ ┌─────────────────┐
│ account_balance │ X X X │ account_balance │
│ $1,000 │ │ $1,000 │
└─────────────────┘ └─────────────────┘
(isolated) (partition) (isolated)
def read_with_consistency(key):
if key in local_cache:
# But am I up-to-date?
try:
acks = sync_with_leader(DC1, timeout=5s)
except NetworkError:
# Can't guarantee this is latest write
# Refusing to respond ensures consistency
raise ServiceUnavailable(
"Cannot guarantee consistency"
)
Result:
✅ Consistency: Won't serve stale 1000if500 exists elsewhere
❌ Availability: Client gets ERROR/timeout instead of response
✅ Partition Tolerance: System handles the partition
code
Request arrives at DC2
Response: 503 Service Unavailable
(or timeout after 5 seconds)
def read_with_availability(key):
if key in local_cache:
# Return immediately, no questions asked
return local_cache[key] # $1000
Result:
❌ Consistency: Serve stale data (1000=actual500)
✅ Availability: Always respond within milliseconds
✅ Partition Tolerance: System handles the partition
code
Request arrives at DC2
Response: $1000 (STALE)
⚠️ Stored $500 in DC1 is never seen
Why Both Is Impossible During Partition
code
Timeline where both would be required:
T2.1: Client B sends: READ account_balance
T2.2: To be AVAILABLE → respond within SLA (say 100ms)
T2.3: To be CONSISTENT → must value that includes T1's write
But DC2 can't contact DC1 where write happened
┌──────────────────────────────────────────┐
│ You CAN'T do both: │
│ ✗ Know new value (requires sync) │
│ ✗ Know immediately (partition prevents) │
│ → Must pick one │
└──────────────────────────────────────────┘
Information-Theoretic Argument
Consistency requires: "Latest value = $500"
Information about this write exists only in DC1
Availability requires: "Respond in < T milliseconds"
Time to learn new value = ∞ (partition blocks communication)
vs.
Response deadline = 100ms (availability SLA)
∞ > 100ms → Cannot satisfy both
Real System Trade-offs
System
Choice
Strategy
Cassandra, DynamoDB
AP
Return stale data, sync later
HBase, Zookeeper, etcd
CP
Stop responding until partition heals
PostgreSQL (single DC)
CA
Assume no partitions (wrong for multi-DC)
Eventual consistency systems
AP
"Conflicts okay, reconcile later"
Cassandra (NYC ↔ SF partition):
code
Write: balance = 500 at NYC
Read at SF during partition → 1000 (stale, but AVAILABLE)
↓ (after partition heals)
Consistency: vector clocks detect write, reconcile to 500
Zookeeper (NYSE ↔ Chicago partition):
code
Write reaches 5-node quorum in Chicago
Read request from a node in isolated NYSE partition
↓
Response: 503 Service Unavailable (CP mode)
"Quorum not available"
Conclusion: The Core Dilemma
During a network partition, for any read request:
Waiting for partition to heal / verify with other partition