HandbookXV the PantheonConsistency trade-offs
XVthe Pantheon, Design the systemConsistency trade-offs
In plain words
The CAP theorem says that when a network partition splits a distributed system, each side must choose between staying consistent, by refusing some requests, and staying available, by answering with data that may be out of date.
Where you see it
Harbor runs in two regions, and the link between them drops for a minute. Should the Europe region keep accepting custom domain claims, risking two customers claiming the same name, or refuse them until the link returns? That decision is made per feature.
What goes wrong
- Treating it as pick two of three
Partitions aren't optional in a real network, so the real choice is what to do when one happens. The rest of the time you trade latency against consistency, which the PACELC framing adds.
- One choice for the whole system
The domain registry needs consistency while the activity feed wants availability. Decide per feature, by what a wrong or missing answer would cost.
- Assuming your database's defaults
Replicated databases and caches differ in what they promise during failures, and settings like synchronous replication change it. Read what yours guarantees, and test a failover before you rely on it.
What to tell your agent
Quick check
Sign in to earn +10 XP for itDuring a network split between Harbor's two regions, which feature should refuse writes rather than accept them on both sides?