Member-only story
CAP Theorem & Consistency Model: Tradeoffs in availability, consistency, and partition tolerance
What is CAP Theorem?
CAP Theorem is a concept in theoretical computer science that states that distributed data stores can only provide two of the three desired characteristics: consistency, availability, and partition tolerance. In other words, when a network failure occurs, a distributed database system must choose between either providing consistency or availability.
Consistency vs Availability vs Partition tolerance
At its core, CAP Theorem is about trade-offs. It implies that we cannot have all three properties at once and must instead make a choice between two of them.
— Consistency means that the data stored in the system is always up to date and accurate across all nodes.
— Availability means that the system will always respond to requests even if some nodes are down or unavailable.
— Partition tolerance means that the system can continue to operate even if there are communication issues between different nodes in the system.
When it comes to use cases for CAP Theorem, it is most relevant in distributed systems where data needs to be shared across multiple nodes. For example…