In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees:
Consistency
Every read receives the most
recent write or an error.
Availability
Every request receives a
(non-error) response, without the guarantee that it contains the most recent
write.
Partition tolerance
The system continues to
operate despite an arbitrary number of messages being dropped (or delayed) by
the network between nodes.
When a network partition failure happens, it must be decided whether to
•cancel the operation and thus decrease
the availability but ensure consistency or to
•proceed with the operation and thus
provide availability but risk inconsistency.
The CAP theorem implies that
in the presence of a network partition, one has to choose between consistency
and availability.
Today,
NoSQL databases are classified based on the two CAP characteristics they
support:
CP database:
A CP database delivers consistency and
partition tolerance at the expense of availability. When a partition occurs
between any two nodes, the system has to shut down the non-consistent node
(i.e., make it unavailable) until the partition is resolved.
AP database:
An AP database delivers availability and
partition tolerance at the expense of consistency. When a partition occurs, all
nodes remain available but those at the wrong end of a partition might return
an older version of data than others. (When the partition is resolved, the AP
databases typically resync the nodes to repair all inconsistencies in the
system.)
CA database:
A CA database delivers consistency and availability across all nodes. It can’t do this if there is a partition between any two nodes in the system, however, and therefore can’t deliver fault tolerance.
No comments:
Post a Comment
If you have any doubt or question, please contact us.