Patterns
35 items
35 items
Linearizable operations for correctness guarantees
Strong Consistency (Linearizability) guarantees that all operations appear to occur atomically and in total order. Once a write completes, all subsequent reads see that write. This provides the strongest correctness guarantee but comes at significant cost: lower availability during partitions, higher latency, and limited scalability. Essential for financial transactions and inventory management.
Linearizability means operations appear to occur instantaneously at some point between invocation and response. Once a write completes, all reads see that value or newer—never older.
Strong consistency requires choosing Consistency and Partition tolerance (CP). During partitions, the system sacrifices availability—nodes that cannot communicate with majority must refuse operations.
Achieving strong consistency requires consensus protocols like Raft or Paxos. These ensure all nodes agree on operation order, even during failures. They work by having a leader coordinate writes with majority acknowledgment.
Eventual consistency introduces complexity. Applications must handle stale reads, conflicting writes, and non-linearizable behavior. Strong consistency eliminates these concerns by guaranteeing all operations see consistent state.