Cloud computing has enriched the digital world with many new pos­si­bil­i­ties. Providing computing resources via the internet enables in par­tic­u­lar rapid in­no­va­tion, flexible resource use, and re­spec­tive scaling options which can be in­di­vid­u­al­ly con­fig­ured to your own re­quire­ments. However, the CAP theorem demon­strates that guar­an­tee­ing this flex­i­bil­i­ty results in com­pro­mis­es being made in other areas. We will explain what the CAP theorem is (also referred to as Brewer’s theorem) and show where this theorem about dis­trib­uted systems can be observed in practice.

Compute Engine
The ideal IaaS for your workload
  • Cost-effective vCPUs and powerful dedicated cores
  • Flex­i­bil­i­ty with no minimum contract
  • 24/7 expert support included

What is the CAP theorem?

The CAP theorem states that it is im­pos­si­ble to provide or guarantee more than two out of the following three prop­er­ties at the same time in a dis­trib­uted system:

  • Con­sis­ten­cy: All clients see the same data at the same time.
  • Avail­abil­i­ty: All clients can perform read and write accesses at any time since the system always responds.
  • Partition tolerance: The system can continue to operate as a whole even if in­di­vid­ual nodes fail or can no longer com­mu­ni­cate with each other.
Fact

The CAP theorem is based on a con­jec­ture set forth by the computer scientist Eric Brewer which he presented at the 2000 Symposium on Prin­ci­ples of Dis­trib­uted Computing (PODC). This principle on the lim­i­ta­tion of prop­er­ties in dis­trib­uted systems is also referred to as Brewer’s theorem. In 2002, Seth Gilbert and Nancy Lynch of MIT published an axiomatic proof of this con­jec­ture and, thus, es­tab­lished it as a theorem.

Nowadays, when building a new dis­trib­uted system, this theorem is used as a reference, and a basic model is chosen that focuses on two of the three prop­er­ties. Groups of in­de­pen­dent computers in a single system can generally be divided into three cat­e­gories according to the CAP theorem:

  • CP system (con­sis­ten­cy and partition tolerance)
  • AP system (avail­abil­i­ty and partition tolerance)
  • CA system (con­sis­ten­cy and avail­abil­i­ty)

The CAP theorem in practice

To clarify the idea behind the CAP theorem, the following examples of dis­trib­uted systems will prove the principle’s validity. In addition, they emphasize in what respect Brewer’s theorem is valid.

Example of an AP system: the domain name system

A well-known example of an AP system is the DNS (i.e. the domain name system). This central network component is re­spon­si­ble for resolving domain names into IP addresses and focuses on the two prop­er­ties avail­abil­i­ty and partition tolerance. Due to the large number of servers, this system is virtually available all the time. If a DNS server fails, the next one will take its place. However, con­sis­ten­cy is not guar­an­teed with the DNS according to the CAP theorem. If a DNS entry is modified, it may take several days before the mod­i­fi­ca­tion is passed on to the system hierarchy and becomes visible for all clients.

Example of a CA system: re­la­tion­al database man­age­ment systems

Database man­age­ment systems based on the re­la­tion­al database model are a good example of CA systems. These database systems are primarily char­ac­ter­ized by a high level of con­sis­ten­cy and also strive to achieve the highest possible level of avail­abil­i­ty. However, under certain cir­cum­stances, avail­abil­i­ty can be reduced in favor of con­sis­ten­cy. Meanwhile, partition tolerance plays a less important role.

Example of a CP system: financial and banking ap­pli­ca­tions

High avail­abil­i­ty is one of the most important prop­er­ties in the majority of dis­trib­uted systems which is why CP systems are rarely used in practice. However, these systems have proven to be par­tic­u­lar­ly valuable in the financial sector. Banking ap­pli­ca­tions need to be able to reliably debit and transfer funds from accounts. They depend on con­sis­ten­cy and partition tolerance to prevent ac­count­ing errors – even in the event of dis­rup­tions in data traffic.

Go to Main Menu