- 2073 Magh · 3+7 marks
NoSQL term and CAP theorem
Short answer
NoSQL ('Not Only SQL') denotes non-relational databases with flexible schemas and horizontal scaling, trading ACID for BASE. The CAP theorem states a distributed system can guarantee at most two of Consistency, Availability, and Partition Tolerance; since partitions are inevitable, systems choose between consistency (CP) and availability (AP).
Explain the term NO-SQL. Explain CAP theorem with suitable block diagram.
NoSQL
NoSQL stands for "Not Only SQL". It refers to a class of non-relational databases designed for large-scale, distributed data. They do not use the fixed table schema and JOINs of an RDBMS, and they relax some ACID guarantees in return for scalability and availability.
Main features:
- Schema-less / flexible schema
- Horizontal scaling over clusters of commodity servers
- High availability through replication
- Handles structured, semi-structured and unstructured data
- Eventual consistency (BASE) rather than strict ACID
Types: key-value, document, column-family and graph. Examples: MongoDB, Cassandra, HBase, Redis, Neo4j.
CAP theorem
The CAP theorem (Eric Brewer, proved by Gilbert and Lynch) states that a distributed data store can guarantee at most two of the following three properties at the same time:
- Consistency (C): all nodes see the same data at the same time; every read returns the most recent write.
- Availability (A): every request receives a (non-error) response, even if some nodes are down.
- Partition tolerance (P): the system keeps working even if the network breaks and nodes cannot communicate.
Since network partitions cannot be avoided in a distributed system, the real choice during a partition is between consistency and availability.
Consistency
/\
/ \
CA / \ CP
(RDBMS)/ X \(HBase,
/ \ MongoDB)
/________\
Availability AP Partition
(Cassandra, tolerance
CouchDB)
| Combination | Meaning | Examples |
|---|---|---|
| CA | Consistent and available, but cannot tolerate partitions (single-node or tightly coupled) | Traditional RDBMS (MySQL, Oracle) |
| CP | Consistent and partition tolerant; some requests are refused during partition | HBase, MongoDB, Redis |
| AP | Available and partition tolerant; data may be temporarily stale | Cassandra, CouchDB, DynamoDB |
Example: a bank system chooses CP (never show a wrong balance, even if it has to refuse a request), while a social media feed chooses AP (it is acceptable to show slightly old posts).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Short note: CAP theorem · Big Data Technologies, chapter 4
- DCS block diagram and S/H tracking/hold modes · Digital Control System, chapter 1
- Block diagram of electric drive; series vs shunt starting · Utilization of Electrical Energy, chapter 2
- Frequency counter operation with block diagram · Digital Logic, chapter 11 · asked 14×
- Block diagram of digital communication system · Data Communication, chapter 1 · asked 8×