Build fluency in the vocabulary of the fundamental trade-off between consistency and availability during a network partition.
0 / 5 completed
1 / 5
A teammate explains that during a network partition, a distributed database must choose between always answering reads and writes or always returning the most recent write, but cannot guarantee both while the partition persists. What theorem describes this fundamental trade-off?
The CAP theorem is exactly this: it states that during a network partition, a distributed system can guarantee either consistency, meaning every read returns the most recent write, or availability, meaning every request gets a response, but not both at the same time. A hash collision is an unrelated hash-table concept about two keys sharing a bucket. This consistency-versus-availability trade-off is exactly why distributed databases are labeled CP or AP depending on which guarantee they preserve during partitions.
2 / 5
During a design review, the team picks an AP database for a shopping cart service, specifically so the service keeps accepting reads and writes even during a network partition, accepting that some replicas may briefly serve stale cart contents. Which capability does this provide?
This provides continued availability during a partition, since the system keeps responding to requests even though some replicas may temporarily diverge and serve stale data until the partition heals and they resynchronize. A CP database would instead refuse some requests during the partition to guarantee every read reflects the latest write. This favor-availability-over-freshness trade-off is exactly why AP databases are chosen for shopping carts, where staying responsive matters more than perfectly current state.
3 / 5
In a code review, a dev notices a service is deployed with a CP database configuration for a use case that tolerates brief staleness but cannot tolerate any downtime during a partition, such as a checkout button that must always respond. What does this represent?
This is a CAP-theorem mismatch, since choosing consistency over availability means the checkout button can become unresponsive during a partition, which this use case cannot tolerate. A cache eviction policy is an unrelated concept about discarded cache entries. This consistency-over-availability mismatch is exactly the kind of misconfiguration a reviewer flags once uptime during partitions is confirmed to matter more than guaranteed freshness.
4 / 5
An incident report shows a checkout service became fully unresponsive during a brief network partition because its CP database refused to serve any request rather than risk returning stale data. What practice would prevent this?
Choosing an AP database configuration for the checkout service ensures requests keep being served during a partition even at the cost of occasional staleness. Continuing to run the CP database configuration regardless of how much downtime a partition causes for the checkout service is exactly what caused the outage described in this incident. This favor-availability approach is the standard fix once uptime during partitions is confirmed to matter more than guaranteed consistency for this use case.
5 / 5
During a PR review, a teammate asks why the team reaches for the CAP theorem's framing instead of just picking whichever database is fastest in benchmarks, given that raw throughput numbers are easier to compare. What is the reasoning?
The CAP theorem forces an explicit choice about what happens during a partition, which benchmark throughput numbers never capture, while picking purely on speed ignores whether the system stays correct or available when the network actually fails. This is exactly why architects reason from the CAP theorem when choosing a distributed database, while raw benchmark numbers remain useful only for comparing performance within an already-chosen consistency model.