Q. About MongoDB's CAP

I am currently studying CAP.

CAP

  • 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.
  • Partitioning Tolerance
    The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes.

And MongoDB also learned that it is a model that guarantees CP.

I understand guaranteeing Consistency and not guaranteeing Availability, but I don’t understand guaranteeing Partitioning Tolerance.

Can I ask you to explain?

Hi @Kim_Hakseon,

Partition tolerance is referring to a distributed system continuing to operate even if a network partition or failure interrupts communication between some members. Distributed databases are either CP or AP because they are inherently designed to be resilient. MongoDB production deployments use sharded clusters and replica sets for fault tolerance and data redundancy.

Quoting from my response to a related question on DBA Stack Exchange (mongodb - Mongo CP, Cassandra AP? - Database Administrators Stack Exchange):

CAP is a simplification of real-world behaviour: MongoDB and Cassandra both have tuneable levels of consistency for reads and writes. For example: MongoDB has write concerns to determine the level of acknowledgement required for write operations, read preferences for routing requests to members of a replica set, and read concerns to control the recency, consistency, and isolation properties of data read from replica set and sharded deployments.

Eric Brewer, author of the CAP Theorem, revisited this in 2012 with a more nuanced take: CAP Twelve Years Later: How the “Rules” Have Changed.

Regards,
Stennie

This is the sentence I have a question about.

@Stennie
Partition tolerance is referring to a distributed system continuing to operate even if a network partition or failure interrupts communication between some members.

This is because if the 3-nodes Replica set is unable to communicate with 2 members due to a network disconnection, the other member will become secondary and will not be able to expect normal service.

Please point out if my example is wrong.