CAP, stated properly
In a distributed data system, when a network partition (P) happens, you must choose between:
- Consistency (C): every read sees the latest write (linearizability), so some requests must be refused or wait.
- Availability (A): every request to a non-failed node gets a response, which may be stale.
Partitions aren't optional (networks fail), so the real choice is CP or AP during a partition. When there's no partition, you can have both.
Saying "we chose CA". You can't opt out of partitions in a distributed system. And "AP" doesn't mean "no consistency ever"; it means "during partitions, we prefer answering over being up to date".
PACELC: the everyday trade-off
CAP only talks about partitions, which are rare. PACELC adds the common case: if Partition, choose A or C; Else, choose Latency or Consistency. Even with a healthy network, waiting for replicas to agree costs time.
| System | During partition | Normally | Notes |
|---|---|---|---|
| Cassandra / DynamoDB (default) | A | L | Tunable per query |
| MongoDB (majority writes/reads) | C | C | Configurable |
| Spanner / CockroachDB | C | C | Pays latency for consensus |
| PostgreSQL + async replicas | C (primary) | L (replica reads) | Depends on where you read |