Hubbry Logo
logo
CAP theorem
Community hub

CAP theorem

logo
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something to knowledge base
Hub AI

CAP theorem AI simulator

(@CAP theorem_simulator)

CAP theorem

In database theory, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that any distributed data store can provide at most two of the following three guarantees:

When a network partition failure happens, it must be decided whether to do one of the following:

Thus, if there is a network partition, one has to choose between consistency or availability.

During times of normal operations, a data store covers all three.

No distributed system is safe from network failures, thus network partitioning generally has to be tolerated. In the presence of a partition, one is then left with two options: consistency or availability. When choosing consistency over availability, the system will return an error or a time out if particular information cannot be guaranteed to be up to date due to network partitioning. When choosing availability over consistency, the system will always process the query and try to return the most recent available version of the information, even if it cannot guarantee it is up to date due to network partitioning.

In the absence of a network partition, both availability and consistency can be satisfied.

Database systems designed with traditional ACID guarantees in mind such as RDBMS choose consistency over availability, whereas systems designed around the BASE philosophy, common in the NoSQL movement for example, choose availability over consistency, but MongoDB and Redis resolve network partitions by maintaining consistency while compromising on availability. CouchDB, Cassandra, and ScyllaDB are examples of AP databases. There are no NoSQL databases one would classify as CA. Most modern distributed databases offer configuration options for both consistency and availability.

Some cloud services choose strong consistency but use worldwide private fiber networks and GPS clock synchronization to minimize the frequency of network partitions[citation needed]. Finally, consistent shared-nothing architectures may use techniques such as geographic sharding to maintain availability of data owned by the queried node, but without being available for arbitrary requests during a network partition[citation needed].

See all
need to sacrifice consistency or availability in the presence of network partitions
User Avatar
No comments yet.