Nosql: MongoDB or BigTable is not always “available”

Read Nathan Hurst’s Visual Guide to NoSQL Systems, he includes the CAP triangle:

>Consistency
>Availability
> Partition tolerance

SQL Server is an AC system, and MongoDB is a CP system.

These definitions come from UC Berkley professor Eric Brewer, and his talk at PODC 2000 (Principles of Distributed Computing):

Availability

Availability means just that – the service is available
(to operate fully or not as above). When you buy the book you want to
get a response, not some browser message about the web site being
uncommunicative. Gilbert & Lynch in their proof of CAP Theorem make
the good point that availability most often deserts you when you need
it most – sites tend to go down at busy periods precisely because they
are busy. A service that’s available but not being accessed is of no
benefit to anyone.

In the context of MongoDB or BigTable, the system is What does it mean if it is not “available”?

Are you connected (for example via TCP/IP) and the server does not respond? Did you try to execute a query, but the query never returns-or returns an error?

What does it mean to be unavailable?

The availability in this case means that in the case of a network partition, the client connects to The server may not be able to guarantee the level of consistency that the client expects (or the system is configured to provide it).

Assume that there are 3 nodes A, B, and C in a hypothetical distributed system. A, B and C each run in their own server rack, and there are two switches between them:

[Node A] <- Switch #1 -> [Node B] <- Switch #2 -> [Node C ]

Now suppose that the system is set up so that it is guaranteed that any write will reach at least 2 nodes before being considered committed. Now, suppose switch #2 is unplugged and some clients connect to node C:

[Node A] <- Switch #1 -> [Node B] [Node C ] <-- Some client

Because the distributed system is currently in a partitioned state (that is, node C cannot contact enough other nodes to ensure the required 2-node consistency), the client will not be able to issue a consistent Write.

I will add that some NoSQL databases allow very dynamic selection of CAP attributes. For example, Cassandra allows the client to specify the number of servers that the write must reach before each write. Writes to a single server are "AP", and writes to statutory (or all) servers are more "CA".

Edit-from the following comments:

In MongoDB, you can only perform master/slave configuration in the replica set. This means that the selection of AP and CP is performed by the client during query. The client can specify slaveOk, which will read from any selected slave (may have outdated data): mongodb.org/display/DOCS/... If the client has unstable data, please do not specify slaveOk, and the query will go to the master server. If the client cannot access the main server, then you will receive an error message. I don't know what this error is.

Read Nathan Hurst’s Visual Guide to NoSQL Systems, he includes the CAP triangle:

>Consistency
>Availability
>Partition tolerance

SQL Server is an AC system, and MongoDB is a CP system.

These definitions come from UC Berkley professor Eric Brewer, and his talk at PODC 2000 (Principles of Distributed Computing):

Availability

Availability means just that – the service is available
(to operate fully or not as above). When you buy the book you want to
get a response, not some browser message about the web site being
uncommunicative. Gilbert & Lynch in their proof of CAP Theorem make
the good point that availability most often deserts you when you need
it most – sites tend to go down at busy periods precisely because they
are busy. A service that's available but not being accessed is of no
benefit to anyone.

In the context of MongoDB or BigTable, the system is What does it mean if it is not "available"?

Are you connected (for example via TCP/IP) and the server does not respond? Did you try to execute a query, but the query never returns-or returns an error?

What does it mean to be unavailable?

The availability in this case means that in the case of a network partition, the server the client connects to may not guarantee the level of consistency the client expects (Or system configuration is provided).

Assume that there are 3 nodes A, B, and C in a hypothetical distributed system. A, B and C each run in their own server rack, and there are two switches between them:

[Node A] <- Switch #1 -> [Node B] <- Switch #2 -> [Node C ]

Now suppose that the system is set up so that it is guaranteed that any write will reach at least 2 nodes before being considered committed. Now, suppose switch #2 is unplugged and some clients connect to node C:

[Node A] <- Switch #1 -> [Node B] [Node C ] <-- Some client

Because the distributed system is currently in a partitioned state (that is, node C cannot contact enough other nodes to ensure the required 2-node consistency), the client will not be able to issue a consistent Write.

I will add that some NoSQL databases allow very dynamic selection of CAP attributes. For example, Cassandra allows the client to specify the number of servers that the write must reach before each write. Writes to a single server are "AP", and writes to statutory (or all) servers are more "CA".

Edit-from the following comments:

In MongoDB, you can only perform master/slave configuration in the replica set. This means that the selection of AP and CP is performed by the client during query. The client can specify slaveOk, which will read from any selected slave (may have outdated data): mongodb.org/display/DOCS/... If the client has unstable data, please do not specify slaveOk, and the query will go to the master server. If the client cannot access the main server, then you will receive an error message. I don't know what this error is.

Leave a Comment

Your email address will not be published.