Partition forces a choice
During a network partition, only the side holding a majority of replicas can satisfy QUORUM; you must pick consistency (refuse the minority) or availability (accept divergence).
W+R>N gave us read-your-writes when every replica is reachable; once the network splits the cluster in two, the minority side can no longer count to a majority.
Scene 09
Partition forces a choice
- Watch
- Try it
- Predict
- Capture
The cluster has split. A dashed line marks the network partition: 5 nodes on side A (with the coordinator), 3 on side B. The featured key has 3 replicas — 2 on the majority side, 1 on the minority. The verdict box on the right reads off whether the cluster can serve this key under the current consistency level.
Highlighted lines are the ones running in the diagram right now.
def coordinator_reach(key):replicas = ring.replicas_for(key) # RF nodesreachable = []for r in replicas:if can_route_to(r): # ping / gossip viewreachable.append(r)# on a partition this is sideA-only countreturn reachable
def write(key, value, CL):reach = coordinator_reach(key)needed = quorum(CL, RF)# ONE → 1 · QUORUM → floor(RF/2)+1 · ALL → RFif len(reach) < needed:return Unavailablefor r in reach:send_async(r, Write(key, value))wait_for(reach, count=needed)return Ack
def quorum(CL, RF):if CL == 'ONE':return 1if CL == 'QUORUM':return RF // 2 + 1 # 2 when RF=3if CL == 'ALL':return RF # 3 when RF=3
Where this sits in Build a wide-column store (Cassandra / DynamoDB family)
Scene 09 of 13, in the Tunable & CAP act — W+R>N for strong reads; per-request choice between A and C under partition.. Split the cluster in two; one side keeps quorum, the other goes unavailable — or you accept divergence.
Up next. Partitions are dramatic; the everyday case is a single replica blipping for a few seconds — for that the cluster has a softer trick.
All 13 scenes in Build a wide-column store (Cassandra / DynamoDB family) · Every curriculum