---
title: "Short note: CAP theorem"
subject: "Big Data Technologies"
chapter: 4
key: "semester_8/big_data_technologies:short-note-cap-theorem"
source: https://www.bctengineer.com/q/semester_8/big_data_technologies/short-note-cap-theorem
site: BCT Engineering
---

# Short note: CAP theorem

Big Data Technologies · Chapter 4: NoSQL

- Asked in: 2073 Bhadra, 5 marks
- Video: [CAP Theorem Simplified](https://www.youtube.com/watch?v=BHqjEjzAicA) — ByteByteGo
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/big_data_technologies/short-note-cap-theorem
- Whole chapter: https://www.bctengineer.com/md/semester_8/big_data_technologies/chapter-4

## Question

Write a short note on CAP theorem.

## Short answer

The CAP theorem limits a distributed data store to two of Consistency, Availability, and Partition Tolerance. Since network partitions are inevitable, systems must trade off: CP (e.g., HBase) preserves consistency, possibly rejecting requests; AP (e.g., Cassandra) remains available but returns potentially stale data (eventual consistency).

## Answer

The **CAP theorem** (Brewer's theorem) states that a distributed data store can provide at most two of these three guarantees at the same time: **Consistency**, **Availability** and **Partition tolerance**.

- **Consistency:** every read returns the latest write, so all nodes show the same data.
- **Availability:** every request to a working node gets a response (not an error), even if some nodes fail.
- **Partition tolerance:** the system continues to operate when messages between nodes are lost or delayed because of a network split.

In a real distributed system, network partitions will happen, so partition tolerance is a must. The designer must choose, during a partition, between consistency and availability.

```text
   C ---- A        CA: RDBMS (single node)
    \    /         CP: HBase, MongoDB, Redis
      P            AP: Cassandra, CouchDB, Dynamo
```

| Type | Gives up | Behaviour | Examples |
|---|---|---|---|
| CA | P | Works only if network is reliable | MySQL, Oracle |
| CP | A | May reject requests to keep data correct | HBase, MongoDB |
| AP | C | Always responds, data may be stale (eventual consistency) | Cassandra, DynamoDB |

**Example:** Two replicas of a shopping database lose connection. A CP system stops accepting writes on one side to avoid conflicting values. An AP system accepts writes on both sides and reconciles later.

The theorem explains why NoSQL systems use BASE (Basically Available, Soft state, Eventually consistent) instead of strict ACID.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does the CAP theorem state about a distributed data store?
   A. It can provide all three of C, A and P at once if nodes are fast enough
   B. It can provide at most two of Consistency, Availability and Partition tolerance at the same time
   C. It must always give up consistency
   D. It can provide only one of the three guarantees
   Answer: B. Brewer's theorem says a distributed store can guarantee at most two of the three properties simultaneously. (Key point: Statement of CAP)

2. Why must a designer of a real distributed system choose between consistency and availability?
   A. Because partitions are rare, so P can be ignored
   B. Because consistency and availability are the same thing
   C. Because network partitions will happen, so partition tolerance is a must and the trade-off is between C and A during a partition
   D. Because ACID forbids availability
   Answer: C. Partitions are unavoidable in real networks, so P is required, and during a partition the system must pick C or A. (Key point: Why choose between C and A)

3. Two replicas lose connection. How does an AP system behave compared with a CP system?
   A. AP accepts writes on both sides and reconciles later; CP may stop accepting writes on one side to avoid conflicts
   B. AP stops all writes; CP accepts writes on both sides
   C. Both accept writes on both sides and ignore conflicts
   D. Both shut down completely until the network is repaired
   Answer: A. AP favours availability with eventual consistency, while CP protects correctness by rejecting some requests. (Key point: CP versus AP behaviour)

## Related in Big Data Technologies

- [NoSQL term and CAP theorem](https://www.bctengineer.com/question.md?key=semester_8%2Fbig_data_technologies%3Anosql-term-cap-theorem) — Big Data Technologies, chapter 4
