What Is CAP Theorem?

In short, the CAP theorem is a mathematical theorem describing how our application will behave in the event of network partitioning. It is one of the most important laws currently in existence. Through the course of this text, I will share more information on this theorem and why it is important. By the time you’re done reading, you’ll also know why CAP may not be enough for modern-day systems.

Before we start, because the CAP theorem is inseparably related to distributed systems, I would like to add a quick word about them.

CAP Is Not the Whole Story: Introducing Trust and Blockchain

The CAP theorem asserts that in any distributed data store only two out of three guarantees can be provided regarding consistency, availability, and partition tolerance. But what about trust?

In commercial systems on the internet partition tolerance can never be fully guaranteed, limiting the choice to either consistency or availability. As availability has the most significant impact on revenue, the system design of distributed data stores for businesses reduces to a choice between different eventual consistency recovery strategies.

MongoDB: Consistency Levels and the CAP/PACLEC Theorem

Consistency Levels and the CAP/PACLEC Theorem

There is a lot of discussion in the NoSQL community about consistency levels offered by NoSQL DBs and its relation to CAP/PACELC theorem. This article seeks to address this w.r.t MongoDB in-depth, thereby providing a broad overview of approaching CAP and PACLEC theorems from a NoSQL perspective. For a quick summary of consistency levels, please refer to Consistency Matrix towards the end of the article.

You might also enjoy:  Understanding the CAP Theorem

MongoDB Notes for the Purpose of This Article

  1. MongoDB always replicates data asynchronously from primary to secondaries. This cannot be changed.

RocketMQ: HA Design

Decisions decisions

When any messaging system sends messages, there will be errors. Even though the name servers do check the health of brokers beforehand, there is always delay. Plus, a network outage can happen during the transmission. But the handling of errors can be different.

The CAP Theorem is a fundamental theorem in distributed systems that states that any distributed system can have, at most, two of the following three properties: Consistency, Availability, and Partition tolerance. The following diagram shows the tradeoffs:

Understanding the CAP Theorem

The CAP theorem is a tool used to makes system designers aware of the trade-offs while designing networked shared-data systems. CAP has influenced the design of many distributed data systems. It made designers aware of a wide range of tradeoffs to consider while designing distributed data systems. Over the years, the CAP theorem has been a widely misunderstood tool used to categorize databases. There is much misinformation floating around about CAP. Most blog posts on CAP are historical and possibly incorrect.

It is important to understand CAP so that you can identify the misinformation around it.

How to Choose the Right Database Among Cassandra, MongoDB, and MySQL for Your Applications

In this article, I compared ACID properties, CAP attributes, and other features among Cassandra, MongoDB, and MySQL databases to help you choose the right database for your applications. Choosing the right database primarily depends on application needs. There are many factors that need to be considered while choosing the database, In this article, I mainly focused on the transactional aspect.

Cassandra: A key-value-store that stores data in a schema-less way.