couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajay Pawaskar" <>
Subject RE: Replication Configuration
Date Wed, 23 May 2012 20:49:04 GMT
Thx jens,
	I am going with keeping one couch DB server for write operation and at the same time replicating
updated documents for read on other server

-----Original Message-----
From: Jens Alfke [] 
Sent: Wednesday, May 23, 2012 2:42 AM
Subject: Re: Replication Configuration

On May 22, 2012, at 3:45 PM, Ajay Pawaskar wrote:

                 Can I start Replication on Both Servers

                                               AC è BC

                                               BC è AC ?

Sure, bidirectional replication is very common.

               If yes then what will be probability of overwriting Data of AC by BC or vice
a versa (as load balancer is in between I don't know which server is going to update[I am
updating couch from .net app])

CouchDB will never overwrite data. What can happen is a conflict, if the same document is
updated differently on both servers and then replicated across. Your app will need to detect
the conflict, resolve it by comparing both conflicting revisions, and write the resolved document
back to the database.

It's also possible to structure your system to avoid conflicts, for example by routing all
write requests so that any individual document will only ever be updated on one server. You
can do this pretty easily by taking a hash of the document ID, modulo the number of servers,
and sending the request to the server with that index.


View raw message