# CAP THEOREM

~welcome back with another post…

CAP theorem???

CAP theoremis a mathematical theorem that describes how an application behaves in the event of network partitioning.

This is also called as **Brewer’s Theorem** since the CAP theorem is created by Eric Brewer in 1998.

CAP acronyms for,

## C- Consistency

## A- Availability

## P- Partition Tolerance

Let’s see what these 3 guarantees elaborate…

Consistency

This is a guaranty which defines that, every read receives the most recent write; therefore, all the nodes in the network see the same data at the same time.

Availability

This states that, every request receives a response; but it would not guarantee whether the response is the most recent write.

Partition Tolerance

This defines that, the system will continue to operate despite the number of messages last among network nodes. Simply, it means the system will continues to perform even if there is a network outage in the data center.

****CAP theorem states that, **at most** 2 of the 3 guarantees can be achieved for a database…*

## IMPORTANT:

NOSQL cannot provide consistency and high availability together…

Let’s see what are the database systems that can provide which 2 of the 3 guarantees of CAP theorem…

- CA — Consistency & Availability : RDBMS
- CP — Consistency & Partition Tolerance : MongoDB, HBase, Redis, BigTable
- AP — Availability & Partition Tolerance: Dynamo, Cassandra, CouchDB, Voldemart

# Conclusion

We just briefly learned what is CAP Theorem.

That’s it for now, and please press the clap button if you find this article helpful.