Consistency models define the safety contract between a distributed system and its observers, specifying the valid orderings of read and write operations across replicas.
Consistency is a spectrum of guarantees. Stronger models minimize developer cognitive load but increase latency and reduce availability.
Linearizability is a Safety property. It requires that every operation appears to take effect instantaneously at some point between its invocation and its response.
Weaker than linearizability. It requires that all processes see the same order of operations, and that this order respects the program order of each individual process, but it does not require real-time synchronization.
Only operations that are causally related must be seen in the same order. Concurrent operations (no "happened-before" relation) can be seen in different orders.
A Liveness property. If writes stop, all replicas will eventually converge to the same state. It offers no guarantees on the intermediate state seen by readers.
The PACELC theorem extends CAP by considering the system's behavior during normal operation (Else):
| Model | PACELC Classification | Primary Mechanism |
|---|---|---|
| Linearizable | PC / EC | Paxos, Raft, 2PC |
| Causal | PA / EL | Vector Clocks |
| Eventual | PA / EL | Gossip, Anti-Entropy |
| Model | Behavior | Failure Mode |
|---|---|---|
| Strong | User updates bio; refresh always shows new bio. | Update fails if 1 of 3 nodes is down. |
| Eventual | User updates bio; refresh may show old bio for 2 seconds. | Update succeeds as long as 1 node is up. |
| Causal | User replies to a post; reply never appears before the post. | High metadata overhead (vector clock size). |