.NET API: Bucket Replication, PersistTo, ReplicateTo

Hi,

I have a bucket setup through the Admin UI to replicate to 3 nodes.

The .NET API exposes the following method:

Client.ExecuteStore(StoreMode.Set, "mykey", object, PersistTo.One, ReplicateTo.One)

What is the effect of calling the method above with ReplicateTo.One and bucket's replication is set to 3?

Thanks,
Brian

2 Answers

« Back to question.

Hello,

As Robin said the ReplicateTo has no impact on the "final replication" of the data. If you have set the number of replicas for the bucket to 3, Couchbase Server will have 3 copies/replicas.

The ReplicatedTo is a durability constraints, the system will be viewed as a success only when these constraints has been validated on the server side. For example if you put a ReplicateTo=1, the operation call will be a success once the cluster has a copy of the data on another node.

You can find information about durability constraints and observe here:
http://www.couchbase.com/docs/couchbase-devguide-2.0/couchbase-sdk-when-...

Regards
Tug
@tgrall

« Back to question.

Hi Brian,

The effect of this will still remain that the document is replicated across 3 nodes, but at Set time due to your use of ReplicateTo.

On another note, can I enquire as to why you wish to use PersistTo and ReplicateTo on data storage? PersistTo can be an expensive operation so usually simply using ReplicateTo would suffice.