From user-return-20937-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed May 23 20:49:31 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 628529AB5 for ; Wed, 23 May 2012 20:49:31 +0000 (UTC) Received: (qmail 10568 invoked by uid 500); 23 May 2012 20:49:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 10517 invoked by uid 500); 23 May 2012 20:49:29 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 10506 invoked by uid 99); 23 May 2012 20:49:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2012 20:49:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.74.43.152] (HELO genesis_mail.vitalhuber.local) (209.74.43.152) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2012 20:49:22 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Replication Configuration X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 23 May 2012 16:49:04 -0400 Message-ID: <7AC0D97469D66A468B50FA88A9AC4F17DBF9B0@genesis_mail.vitalhuber.local> In-Reply-To: <83E29036-4136-4785-A090-1BF4D6A0BBF1@couchbase.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Replication Configuration Thread-Index: Ac04ry98VC+Bk1r5QES+DVQIDqAKyAAdfwIA References: <7AC0D97469D66A468B50FA88A9AC4F17DBF90F@genesis_mail.vitalhuber.local> <83E29036-4136-4785-A090-1BF4D6A0BBF1@couchbase.com> From: "Ajay Pawaskar" To: 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 [mailto:jens@couchbase.com]=20 Sent: Wednesday, May 23, 2012 2:42 AM To: user@couchdb.apache.org Subject: Re: Replication Configuration On May 22, 2012, at 3:45 PM, Ajay Pawaskar wrote: Can I start Replication on Both Servers AC =E8 BC BC =E8 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. -Jens