Linearizability deep dive — strongest single-object consistency model. Shows etcd-style 3-node Raft cluster with leader and 2 followers (one in-sync, one lagging ~80ms). Two clients: A writes, B reads. Three scenarios: (1) linearizable read via leader with quorum read-index — B sees A's write immediately; (2) non-linearizable stale read directly from lagging follower — B sees old value violating real-time order; (3) comparison of linearizable vs sequential vs causal consistency — what each model guarantees and where it breaks. Includes ADR on the cost of linearizability and when to use it (locks, leader election, unique constraints) vs skip it (feeds, analytics, counters).
A concurrent history is linearizable when each completed operation can be placed at one point between its invocation and response so the resulting sequential history obeys the object specification and real-time precedence. If operation A responds before B is invoked, A must precede B. Overlapping operations may be ordered either way if the sequential specification permits it.
Linearizability is a safety property and is local/compositional by object. It does not promise progress, fairness, or availability, and per-key linearizability does not create a multi-key transaction. Pending operations require careful completion or removal when checking a history; a timeout may have taken effect.
real-time-order): A completed write before a later read invocation constrains the read result.overlapping-writes): Two overlapping operations may linearize in either legal order.stale-read-violation): A read invoked after completed write(2) cannot return the older 1.pending-operation): A timeout may have taken effect and must stay ambiguous in the history.per-key-not-transaction): Each key can be linearizable while a two-key transfer exposes a partial state.partition-unavailability): An isolated replica cannot safely acknowledge a conflicting mutation while preserving linearizability.Введите числа или выберите пресет