Last Minute Notes
  • Github
  • Docs
  • Learn
    @sayanstwt
Lessons
0/37 done
  • CAP & PACELC
  • Consistency Models
  • Time & Ordering
  • Consensus with Raft
  • Locks, Leases & Fencing
  • Isolation Levels & Anomalies
  • 2PC & Sagas
  • Idempotency & Exactly-Once
Learn/System Design/Distributed Systems

CAP & PACELC

7 min Intermediate 7 steps

During a partition you pick consistency or availability. Otherwise, latency.

Replicas
2
Network
healthy
Replica 2
x=1
replicatesWriterReplica 1x=1Replica 2x=1Readerx=2x=2healthy: write, then replicate
request response data
In this lessonStep 1 of 7
  1. The problem
  2. CAP
  3. Choose CP
  4. Choose AP
  5. PACELC
  6. By domain
  7. Recap
Step 1 / 7problem

The network splits the replicas

Normally a write lands on Replica 1 and is copied to Replica 2, so a reader on either side sees it.

Then the link between them breaks. A new write reaches Replica 1, but Replica 2 cannot hear about it.

Key idea

Partitions are not optional in a real network. The question is what a replica does while one lasts.

←→ step·R replay·Space pause

You'll learn

  • Why a network partition forces a choice
  • What CP and AP systems do during a partition
  • How PACELC adds the latency vs consistency choice
  • Pick C or A per domain
Read the full notesSystem Design Fundamentals, 8