Understanding NoSQL, the CAP Theorem, and BASE Theory in Distributed Databases
This article explains the rise of NoSQL databases, the CAP theorem and its CP/AP trade‑offs, critiques of CAP, and the BASE model, illustrating concepts with examples such as HBase and discussing how these principles guide modern distributed data systems.
NoSQL Movement
Since the 1980s relational databases dominated back‑end systems, but exploding data volumes, higher query latency requirements, and the proliferation of unstructured data have driven the emergence of the NoSQL (not only SQL) movement.
NoSQL databases have made breakthroughs in distribution, real‑time performance, scalability, and schema‑lessness, and are categorized into four storage models: key‑value, column‑family, graph, and document.
NoSQL systems typically forgo strict ACID guarantees, basing their design on the CAP and BASE theories.
CAP Theory
Proposed by Eric Brewer in 2000 and proven in 2002, the CAP theorem states that a distributed system can satisfy at most two of the three properties: Consistency, Availability, and Partition Tolerance.
In a distributed system, it is impossible to simultaneously provide consistency, availability, and partition tolerance; you can only guarantee two of them.
Consistency : every read receives the most recent write or an error.
Availability : every request receives a (non‑error) response, without guaranteeing it contains the latest write.
Partition Tolerance : the system continues to operate despite arbitrary network partitions between nodes.
Choosing CP or AP
Because partition tolerance is essential in distributed environments, designers must trade off between consistency (CP) and availability (AP). An illustrative model with two data centers replicating data shows the two possible outcomes when the replication link fails:
AP: both sites remain read/write, but data diverges, sacrificing consistency.
CP: only one site remains operational, preserving consistency while sacrificing availability.
HBase is an example of a CP system: it provides strong consistency for row operations, but when a region server becomes unreachable, the master marks it failed and halts service for that region, thus losing availability.
If HBase 2.0+ region replica feature is enabled, it can behave more like an AP system.
Is the CP/AP Classification Strict?
Martin Kleppmann argues that CAP’s definitions are too narrow—its notion of consistency is limited to linearizability, its availability ignores real‑world latency, and it overlooks many failure modes beyond network partitions.
He also notes that CAP only considers single‑key reads/writes and ignores transactions, leading to oversimplified design decisions.
BASE Theory
Proposed by Dan Prichett in 2008, BASE stands for Basically Available, Soft state, and Eventually consistent, offering an alternative view to ACID for large‑scale internet systems.
Basically Available : the system tolerates reduced performance or partial functionality during failures.
Soft state : intermediate states are allowed and do not affect overall availability.
Eventually consistent : all replicas converge to the same state after a period without further updates.
Many NoSQL databases embody the BASE principles, sacrificing strong consistency for higher availability and eventual convergence.
Achieving eventual consistency can involve heavyweight solutions like distributed transactions (2PC, 3PC, TCC) or lighter approaches such as retries, idempotency, state machines, and redo logs.
Conclusion : The article highlights how NoSQL, CAP, and BASE shape modern distributed database design, emphasizing the need to balance consistency, availability, and partition tolerance according to application requirements.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Big Data Technology & Architecture
Wang Zhiwu, a big data expert, dedicated to sharing big data technology.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
