persistTo and replicateTo


#1

Hi Team,
To resolve data inconsistencies we need to use persistTo and replicateTo in our application in java sdk.
Can you please provide a sample code on how these gonna work using java.

Thanks


#2

I recommend you check out the documentation (i.e. https://developer.couchbase.com/documentation/server/5.1/sdk/java/document-operations.html)

You can easily do this on every mutation in the Java SDK like so: bucket.upsert(doc, PersistTo.MASTER, ReplicateTo.ONE); and so forth.


#3

Hi @daschl,
Thanks for your response.
Few questions daschl…

  1. can you explain me in simple words what persistTo and replicateTo do.
  2. if we don’t use persistTo and replicateTo what that causes because as of now we are not using these operations but our Data Architect recomments us to use this ?
  3. Do we have any standards on persist_to and replicat_to for Couchbase? what usually follows…

Thanks
Kritesh