What is the CAP theorem?
grasp of fundamental distributed-systems limits.
Consistency, Availability, Partition tolerance; during a network partition you must choose between staying consistent or staying available.
WHAT THIS TESTS This confirms you understand the foundational limits of distributed data systems and can reason about behavior under failure, not just under ideal conditions.
A GOOD ANSWER COVERS Consistency means every read returns the most recent successful write or an error, so all nodes agree on the latest value. Availability means every request to a non-failing node receives a non-error response, though not necessarily the freshest data. Partition tolerance means the system keeps operating even when network messages between nodes are lost or delayed. The key insight is that network partitions are a fact of life in distributed systems, so you cannot give up partition tolerance. That leaves a binary choice during a partition: either reject requests to preserve consistency, behaving as a CP system, or serve possibly stale data to preserve availability, behaving as an AP system.
COMMON WRONG ANSWERS The biggest mistake is the classic pick any two of three framing, which implies CA systems are a real option in a distributed setting; they are not, because partitions will happen. Another error is conflating CAP consistency, which is about a single up-to-date value, with ACID consistency, which is about preserving database invariants. Saying a system is just AP or CP forever also misses that the trade-off only binds during a partition.
LIKELY FOLLOW-UPS What does a system do when there is no partition? How does PACELC extend CAP to cover latency? Give an example of a CP store and an AP store. How does tunable consistency fit in?
ONE CONCRETE EXAMPLE A single-leader relational cluster that refuses writes when it cannot reach a quorum is choosing consistency over availability, a CP behavior. A shopping cart on an AP store like Dynamo accepts writes on either side of a partition and reconciles conflicts later, choosing availability and tolerating temporary divergence.
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.