What consistency do you sacrifice in an AP system?
precise reasoning about consistency models and anomaly handling.
you give up linearizability and often sequential consistency, accepting stale reads and conflicts, then mitigate with quorums, vector clocks or CRDTs, and…
WHAT THIS TESTS This is an advanced check on whether you know the spectrum of consistency models and can engineer around the anomalies an availability-first system introduces, rather than waving at eventual consistency.
A GOOD ANSWER COVERS Name what you give up precisely. Linearizability is the strongest model: operations appear to take effect instantaneously in a single global real-time order, and a read always sees the most recent committed write. To stay available under partitions you typically abandon linearizability and often sequential consistency, settling on causal consistency, which preserves cause-and-effect ordering, or plain eventual consistency. The anomalies that follow include stale reads, where a replica returns an outdated value, and conflicting concurrent writes on different replicas. Mitigations include quorum reads and writes, where read plus write replicas exceeding the replication factor guarantees overlap and a fresh read; conflict resolution strategies such as last-write-wins with synchronized clocks, vector clocks to detect concurrency, or conflict-free replicated data types that merge deterministically; and session guarantees like read-your-writes and monotonic reads to keep individual user experience coherent.
COMMON WRONG ANSWERS Saying the system is eventually consistent and stopping there, with no description of which model or anomalies. Claiming last-write-wins is always safe, when it silently drops concurrent updates. Confusing linearizability, a single-object real-time property, with serializability, a multi-object transaction property. Ignoring that quorum tuning lets you dial consistency.
LIKELY FOLLOW-UPS How do R plus W greater than N quorums work? When do vector clocks beat last-write-wins? What problems do CRDTs solve and not solve? How does PACELC describe the latency trade-off when there is no partition?
ONE CONCRETE EXAMPLE A shopping cart on an AP store accepts adds on either side of a partition. Modeling the cart as a CRDT set merges divergent versions by union when the partition heals, so no item silently vanishes, whereas naive last-write-wins could lose an item a user added on one replica.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.