Explore the key trade-offs between consistency and availability in distributed systems with this introductory quiz on the CAP theorem. Understand foundational concepts of partition tolerance and how system design choices impact data correctness and uptime in modern networks.
Which property in the CAP theorem ensures that every client reading data sees the most recent write?
Explanation: Consistency guarantees clients always see up-to-date data, regardless of which node they interact with. Availability instead ensures that each request receives a response, not that it is accurate or current. Partitioning is incorrect, as it refers to network splits, and performance is not a property defined by CAP. The correct answer is consistency because it directly relates to the accuracy and timeliness of data.
In the context of the CAP theorem, what does the availability property ensure during normal network operations?
Explanation: Availability means the system responds to every request, even if the response may not contain the most recent data. Partitioning is unrelated, as it is about network failures, not responses. Eventual erasure of data is not a CAP property, and limiting availability to only write operations is misleading. The key is that every request, read or write, receives a reply.
Suppose a distributed system experiences a temporary network failure separating its nodes; which CAP property addresses the system's ability to continue operating?
Explanation: Partition tolerance is the property that allows a system to continue functioning despite network partitions. Conformity and adaptability are not CAP theorem terms, and accessibility is not defined in this context. A system needs partition tolerance to handle real-world network issues without failing outright.
According to the CAP theorem, what trade-off must a distributed system make when a partition occurs?
Explanation: During a partition, a system must choose to either remain consistent (possibly losing some availability) or stay available (possibly sacrificing consistency). Latency, cost, atomicity, isolation, speed, and security are not the primary trade-offs described by the CAP theorem. The central challenge is balancing consistency and availability during network partitions.
If a distributed database always returns the same value for a query to all clients at all times, which CAP property is being demonstrated?
Explanation: Consistency ensures every client receives the same, most recent value. Concurrency refers to multiple processes happening simultaneously, not to agreement on data. Accessibility and posterity are unrelated to the CAP theorem. Therefore, this scenario highlights consistency as the main property.
Consider a system that always returns a response to client requests, even if some data might be outdated; which property does this best represent?
Explanation: Availability is when a system always replies to requests, even if the returned data is not the latest. Authenticity refers to data genuineness, not response frequency. Conformity and confidence do not refer to system responses in distributed systems. This makes availability the correct answer.
Which of the following is NOT considered a core property of the CAP theorem for distributed systems?
Explanation: Speed, or performance, is not a CAP property; the CAP theorem covers consistency, availability, and partition tolerance. The distractors—consistency, partition tolerance, and availability—are all explicitly part of the theorem. Speed might result from these properties but is not one of them.
During a network outage, some parts of a system cannot communicate, but both parts remain operational; which CAP property is being prioritized by allowing them to function independently?
Explanation: Partition tolerance means that the system remains operable even when parts cannot communicate. Consensus and reconciliation relate to resolving differences or agreeing on data, while simplicity is unrelated. Partition tolerance specifically addresses operation despite temporary network issues.
If a distributed system designer must choose, during a network split, to either reject client requests or risk serving stale data, which two CAP properties are being balanced?
Explanation: The designer is choosing between up-to-date (consistent) data and keeping the system responsive (available) during a partition. Redundancy and security, scalability and efficiency, durability and performance are unrelated to this particular trade-off. Thus, the scenario is a direct example of the CAP theorem's central dilemma.
In the context of the CAP theorem, what do the letters C, A, and P stand for, respectively?
Explanation: CAP stands for Consistency, Availability, and Partition Tolerance, directly representing the three properties in the theorem. The other options are either invented terms or mix unrelated concepts. Only the correct answer reflects the precise terminology used in distributed systems theory.