kolchanov
kolchanov

Reputation: 2088

Couchbase consistency

When couchbase server response to set command:

Upvotes: 2

Views: 2333

Answers (2)

rai.skumar
rai.skumar

Reputation: 10677

Default behavior of Couchbase is that it will write data to only primary node. Write to other replica node(s) happens asynchronously in a peer-to-peer communication style. Also, in fact in the primary node, data is only written to the cache (RAM) when write operation is performed (it gets persisted later).

Upvotes: 0

John Zablocki
John Zablocki

Reputation: 1592

The answer will vary slightly by the client library you're using. But generally speaking, a positive result from calling set implies only that there were no I/O or other errors between the client and server. In such a case, the data should be safely in memory on the master node for a given key.

In 2.0, Couchbase Server and the respective client libraries will support the Observe method, which will allow for durability checks. Calling observe, you'll be able to ask questions like:

  • Is a key in memory on its master node?
  • Is a key persisted to disk on its master node?
  • Has a key been replicated in memory?
  • Has a key been persisted to its replicas?

For more on Observe, see http://www.couchbase.com/wiki/display/couchbase/Observe.

One other point, just to make sure it's clear... Nodes in a Couchbase cluster are all peers in terms of responsibilities, but have master/slave relationships in terms of keys and the replication of those keys. In other words, key "foo" has a single master node, but may be replicated to other nodes as slave copies of that key.

Upvotes: 5

Related Questions