+3 votes
404 views
in Know how by (242k points)
reopened
CAP theorem: consistency, availability, and partition tolerance

1 Answer

+4 votes
by (1.6m points)
edited
 
Best answer

What is the CAP theorem?
The CAP theorem in practice
AP system example: domain name system
CA system example: relational database management systems
CP system example: financial or banking applications

image

CAP theorem: consistency, availability, and partition tolerance

Cloud computing has opened many new paths in the digital world. In particular, the availability of computing resources on the internet allows for rapid innovation, flexible use of resources, and thus tailoring the resulting scalability possibilities to individual needs. However, the CAP theorem shows that this flexibility can hinder other aspects. We explain what is behind the CAP theorem (also called Brewer's theorem or Brewers theorem ) and we present some examples of models that follow this theorem on distributed systems ..

Index
  1. What is the CAP theorem?
  2. The CAP theorem in practice
    1. AP system example: domain name system
    2. CA system example: relational database management systems
    3. CP system example: financial or banking applications

What is the CAP theorem?

The CAP theorem ( CAP theorem ) holds that it is not possible for a distributed system to satisfy or guarantee more than two of the following three properties at the same time:

  • C onsistency - All clients see the same data simultaneously.
  • A vailability (availability): all clients have read and write access at any time, since the system always responds.
  • P artition tolerance - The system continues to function as a whole even when nodes on the network fail or are not communicating with each other.
Done

The CAP theorem arose from an assumption by computer scientist Eric Brewer, who mentioned it during his lecture at the Symposium on Principles of Distributed Computing (PODC) in 2000. Therefore, this proposal on the limitations of characteristics of distributed systems is also known as Brewer's theorem or Brewers theorem . In 2002, Seth Gilbert and Nancy Lynch of MIT demonstrated its validity with axiomatic evidence, establishing it as a theorem.

image
Scheme of the CAP theorem.

Currently, when designing a new distributed system, this theorem is followed and a specific basic model is chosen that has two of the three properties. In this way, the connection of several independent computers in a single network system can be classified into the following three categories, according to the CAP theorem:

  • CP system (consistency and tolerance to partition)
  • System AP (availability and tolerance to partition)
  • CA system (consistency and availability)

The CAP theorem in practice

To make the principles of the CAP theorem a little clearer, we present some examples of distributed systems that demonstrate its validity. In each case we also highlight how Brewer's theorem applies..

AP system example: domain name system

A well-known example of an AP system is the DNS ( domain name system ). This core network component is responsible for associating domain names with the corresponding IP addresses and is based on the properties of availability and partition tolerance . Thanks to the large number of servers that exist, the system is available almost without exception: if one DNS server fails, the next one takes over. However, according to the CAP theorem, DNS is inconsistent : if a record is modified in DNS, it can take up to several days for the change to be transmitted to the entire system hierarchy and can be seen by all clients.

CA system example: relational database management systems

Database management systems that follow the relational database model are a good example of a CA system. These systems are characterized above all by their great consistency and by offering the highest possible availability . However, keep in mind that in the event of a conflict, availability may decrease in favor of consistency. In this case, security in terms of partition has a secondary role..

CP system example: financial or banking applications

Availability is one of the most important properties of most distributed systems, so CP systems are rare in practice . However, these systems prove to be very useful in areas such as finance: banking applications, which must load and transfer money reliably, depend on consistency and partition security to rule out any possibility of incorrect annotations, even if data traffic is interrupted.


...