Skip to content
Optimal Lab

System Design · interactive

CAP: consistency or availability

Networks split. When one replica can't reach the others, it has two choices for a request: refuse it, or answer with what it has, which may be out of date. You have to pick one. Try both.

Replica A

x = 1

up to date

Replica B

x = 1

up to date

Replica C

x = 1

up to date

Network healthy

All three replicas agree: x = 1.

During a partition, prefer

step 1 of 5
  1. 1

    Three copies of the data, so one machine can fail without losing it.

    A, B and C all hold x = 1

  2. 2

  3. 3

  4. 4