Database Basics

Which is an appropriate description of the CAP theorem for a distributed database that keeps copies of data on multiple servers?

  1. AWhen the network between servers is partitioned, consistency (any server returns the latest value) and availability (every request gets a response) cannot both be fully satisfied at the same time
  2. BWith proper design, consistency, availability and partition tolerance can all be satisfied at the same time, always
  3. CPartition tolerance means duplicating network links so that the network between servers is never partitioned
Show answer and explanation

Answer: A. When the network between servers is partitioned, consistency (any server returns the latest value) and availability (every request gets a response) cannot both be fully satisfied at the same time

The CAP theorem shows that a distributed database cannot fully satisfy all three of the following at once: consistency (reading from any server returns the result of the latest write), availability (every server that has not failed responds to every request) and partition tolerance (the system keeps working even when communication between servers is cut). Since network partitions cannot be avoided in practice, the key point is that when a partition occurs, the system must choose between prioritizing consistency, stopping responses to some requests, and prioritizing availability, continuing to respond while allowing stale values to be returned. When there is no partition, both consistency and availability can be satisfied. Many NoSQL products prioritize availability and adopt eventual consistency, in which the copies converge over time. Partition tolerance is not about duplicating links; it is the property of continuing to operate even when a partition occurs.

  • A. Correct. When a partition occurs, the system must choose whether to prioritize consistency or availability.
  • B. The CAP theorem shows that all three cannot be fully satisfied at the same time.
  • C. Partition tolerance is the property of continuing to operate when a partition occurs, not a mechanism for preventing partitions.
Practice this topic Back to topic

Related calculators

Books on Database Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Database Basics questions

  1. In relational database terminology, which term corresponds to one row of a table (relation)?
  2. In a relational database table, which condition must the column (or set of columns) designated as the primary key satisfy?
  3. In an employee table (emp_no, email, name, dept), both emp_no and email are different for every employee and never NULL. Name and dept may be the same as those of other employees. Which lists all the candidate keys of this table?
  4. An enrollment table (student_no, course_no, grade) records which student took which course and with what grade. One student takes several courses, and one course is taken by several students. If the same student never registers for the same course twice, which is an appropriate primary key for this table?
  5. The primary key of a customer table (cust_id, name) is cust_id, and cust_id in an orders table (order_id, cust_id) is defined as a foreign key referring to cust_id in the customer table. The customer table contains only the rows with cust_id 'C1' and 'C2'. What happens when INSERT INTO orders VALUES ('O9', 'C5') is executed in this state?