Understanding CAP Theorem, BASE, and Consistency Models in Distributed Databases
This article explains the CAP theorem, its trade‑offs, the BASE model, various consistency levels, and how parameters N, W, and R are used to achieve strong or eventual consistency in distributed database systems.
In 1998, Eric Brewer introduced the CAP theorem, which states that a distributed system can at most satisfy two of the three properties: Consistency, Availability, and Partition tolerance. The article outlines each property and explains why all three cannot be achieved simultaneously.
It then describes the three possible design choices: CA (sacrificing partition tolerance), CP (sacrificing availability), and AP (sacrificing consistency), giving examples such as traditional relational databases (CA) and NoSQL systems like HBase (CP) or Cassandra (AP).
The concept of BASE (Basically Available, Soft state, Eventual consistency) is introduced as the counterpart to ACID in NoSQL databases, highlighting its three characteristics and how it differs from strong consistency.
Various consistency models are detailed, including causal consistency, read‑your‑writes, monotonic reads, session consistency, monotonic writes, and eventual consistency, explaining when each is applicable.
To achieve specific consistency guarantees, the article presents the N‑W‑R model (replication factor N, write quorum W, read quorum R) and shows how different settings (e.g., W+R> N for strong consistency) affect system behavior.
Practical examples are given: HBase relies on HDFS with strong consistency (W=N, R=1), while Cassandra allows configurable N, W, and R to meet different consistency requirements.
Finally, the article notes that for high availability in distributed systems (e.g., HDFS), a replication factor of at least three is common, and the exact values of W and R depend on the application’s trade‑offs.
360 Tech Engineering
Official tech channel of 360, building the most professional technology aggregation platform for the brand.
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.