Skip to content
BytePatterns

Consistency and CAP

System Design: lesson 10 of 15

When the network splits, you must pick a side.

Lesson 10 of 15 · 6 min

Consistency and CAP

Step 1 of 12

Four nodes, one shared catalogue. Every node reachable, every copy agreeing on v7.

The Idea

CAP says that when a network partition cuts your nodes apart, you can keep answering or you can keep every answer correct — not both. Partitions are not optional, so the real decision is what a node does when it cannot reach its peers: refuse, or reply from what it knows.

Real-World Example

Two branch libraries share one catalogue, and the link between them drops. The strict branch stops issuing loans until it can confirm the copy is free. The available branch keeps lending, accepts that the last copy might be promised twice, and untangles the duplicate later.

The Tradeoff

Strong consistency costs a round trip to agreement on every write, plus an outage whenever a quorum is unreachable. Eventual consistency stays up and hands your application the conflicts to resolve — perfectly fine for a like count, unacceptable for a bank balance.

Your turn

Put the steps in the right order.

  1. Nodes on the minority side refuse writes rather than diverge
  2. The network splits the cluster into two groups
  3. The partition heals and the minority side catches up
  4. The side still holding a quorum keeps accepting writes

Mini quiz

1 / 3

CAP forces a real choice only when: