CAP theorem.
also: CAP · Brewer's theoremDuring a network partition a distributed system must choose consistency (refuse or error) or availability (answer, maybe stale).
the two-minute refresher
- C: every read sees the most recent write or an error. A: every request gets a non-error response. P: the system survives lost messages between nodes.
- Partitions WILL happen, so P is not optional: the real choice is CP or AP during a partition.
- CP: refuse requests until the partition heals (banking ledgers). AP: serve possibly stale data (social feeds).
- Many databases let you tune this per operation, as with Cassandra consistency levels.