Consensus
These notes compare database transactions with agreement across multiple computers.
Page 547
"The best way to build fault tolerant system is to find some general purpose abstraction with some guarantees and assumptions and let the system operate over those guarantees.
For example, a database transaction groups operations behind guarantees such as all-or-nothing completion and isolation from concurrent work.
A general challenge in a distributed system is getting its participants to agree on one decision; that problem is consensus.
Transaction isolation and distributed consistency both limit surprising concurrent behavior, but at different scopes. A race condition is an outcome that changes with timing; concurrency means operations overlap. Replicas are copies of data on different machines, and coordination is the communication that keeps those copies compatible when messages are slow or machines fail.
Cap Theorem
CAP Theorem states that out of:
- Consistency
- Partition
- Availability
During a network partition, a system cannot guarantee both a consistent answer and a response from every reachable side. The theorem is a boundary on guarantees, not a menu where a system permanently chooses any two properties.
Linearizability provides a strong real-time ordering guarantee, but enforcing it across unreliable networks requires coordination and can increase latency.