Apply the CAP theorem to a real system
applying CAP to concrete systems.
define C, A, P; note partitions are unavoidable, so the real choice during one is consistency versus availability; then classify a system as CP or AP with reasoning.
WHAT THIS TESTS This goes beyond definitions to see whether you can analyze how a real system positions itself on the CAP trade-off and justify it from requirements.
A GOOD ANSWER COVERS Start concise: Consistency means every read sees the latest write across nodes, Availability means every request to a live node gets a non-error response, and Partition tolerance means the system keeps working despite lost messages between nodes. Stress that in a distributed system partitions will happen, so you cannot sacrifice partition tolerance; the real decision is what to do during a partition, choosing consistency, becoming a CP system that may reject requests, or availability, becoming an AP system that may serve stale data. Then classify a concrete system. A leader-based relational cluster like a typical PostgreSQL or single-leader setup, or a coordinator-based store like HBase or ZooKeeper, leans CP: during a partition it refuses writes it cannot safely commit, sacrificing availability to avoid divergence. A Dynamo-style store like Cassandra or DynamoDB tuned for availability leans AP: it accepts writes on both sides of a partition and reconciles conflicts afterward, sacrificing immediate consistency. Note many systems offer tunable consistency to slide along this spectrum per query.
COMMON WRONG ANSWERS Reciting only the letter definitions without a real system. Repeating the pick any two of three framing as if CA is achievable in a distributed setting. Confusing CAP consistency with ACID consistency. Labeling a system CP or AP absolutely, forgetting the trade-off only binds during a partition and that tunable consistency exists.
LIKELY FOLLOW-UPS What does the chosen system do when there is no partition? How does PACELC capture the latency trade-off? How does quorum tuning move a system between CP and AP behavior? What anomalies does the AP choice introduce?
ONE CONCRETE EXAMPLE A banking ledger picks CP: if a partition isolates a node, it refuses writes there rather than risk two conflicting balances, accepting some downtime. A shopping cart on DynamoDB picks AP: it keeps accepting adds during a partition and merges the divergent carts when connectivity returns, favoring uptime over momentary consistency.
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.