Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 25706 invoked from network); 27 Oct 2010 10:22:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Oct 2010 10:22:41 -0000 Received: (qmail 84473 invoked by uid 500); 27 Oct 2010 10:22:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 84093 invoked by uid 500); 27 Oct 2010 10:22:38 -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 84073 invoked by uid 99); 27 Oct 2010 10:22:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 10:22:37 +0000 X-ASF-Spam-Status: No, hits=3.6 required=10.0 tests=FREEMAIL_FROM,FS_REPLICA,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of antpky@gmail.com designates 74.125.82.196 as permitted sender) Received: from [74.125.82.196] (HELO mail-wy0-f196.google.com) (74.125.82.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 10:22:30 +0000 Received: by wyb32 with SMTP id 32so68827wyb.11 for ; Wed, 27 Oct 2010 03:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=F/YABUAt8V+CmdxFZD2juCi/O9MUaqDfbVBJLVFeDUs=; b=gmRq+j6xJRCX3G4iqLVgdae6mMOoDMabCk/P2Ia9syxhkZa6qPmxySdFGkD/llkKan 5UOVlyQI98/kiNm0t3TFEHJP65t6PSnBIWNRbzrXAYz6uwk/1Jrdvc4VOh5eirLt8rNa nG7Za62c6M9f4yVLEPrbzVTqAWORbVJRfxQUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UesVzt+rWArElsTiJ5Re/63FsxHrsk0i3/OwrKq4+VDOoaCYm8xbD/5PU6TOonGCEG 3awov3N/lp9XNg4C8MUQYMrHzWMEXexDrxBQH2FXfu6o6866g4hmuRStQd7CMlY+F5hP FYdF85MXP5gUr3fgCwnHEaFg1rPMy1p1+AHhs= MIME-Version: 1.0 Received: by 10.216.23.199 with SMTP id v49mr610894wev.43.1288174928049; Wed, 27 Oct 2010 03:22:08 -0700 (PDT) Received: by 10.216.174.78 with HTTP; Wed, 27 Oct 2010 03:22:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Oct 2010 11:22:07 +0100 Message-ID: Subject: Re: Bidirectional replication and new documents From: Antoine Kurukchi To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the warm welcome. It's really great that all this functionality is in the database from the get go. I've got couchdb running on a couple of machines now and testing how it performs. I should explain what I'm trying to do. I'm looking at having 1-2 master couchdb servers(use continuous replication here) and then have multiple(100 or so) client couchdb connecting up and doing a pull replication. The client database would serve a local application (even if the client isn't on the net). I was thinking I can do a push replication from the clients to the server to update. From what has been said it looks like it would work. Think I will need to be careful with the id fields. http://johnpwood.net/2009/06/30/couchdb-databases-and-documents/ suggests that couchdb generated keys won't work well and I think it won't in my case. As an alternative I can keep the client databases as read only and would store the updates in a separate xml file or something. Update when I know internet is available. It will ensure that no conflicts can happen between the clients and servers. Back to figuring out why replication fails when using nginx and couchdb as a subdirectory. Thanks again Antoine On Tue, Oct 26, 2010 at 8:31 PM, Randall Leeds wrote: > On Tue, Oct 26, 2010 at 11:52, Dave Cottlehuber wrote: >> On 27 October 2010 03:50, Antoine Kurukchi wrote: >>> Hi All, >>> >>> Been reading a lot about couchdb and am really impressed by it. Great >>> work. I have got a few questions about replication and new documents. >> >> Welcome aboard the couch, Antoine. >> >>> A lot is mentioned about continuous replication and bidirectional >>> replication but is it possible to have both features working at the >>> same time? If it is possible, what happens if there is a disconnection >>> between the two database servers and are there any pit falls with this >>> approach? > > Bi-directional replication isn't really a "thing" in CouchDB. There's > been mention recently of adding API sugar to make it easy, but it's > just two replications. Whether they are continuous or not is > irrelevant. > >> >> I've had continuous replication running for some time on a small 3-way >> replicated couch without any issues, in a multi-master mesh (mmm). I >> believe there may be a timeout - can anybody confirm? > > For pull replication, there is no timeout on the source. The source > will stream changes to the target with empty lines every ten seconds > as a heartbeat. If the target misses 3 of these it will give up. So > you have 30 seconds of disconnection before a continuous pull will > fail. The command to start continuous replication is idempotent, > though, so it's easy to set up a job that ensures it's always running > by triggering it every minute or so. In the next release there should > be a way to tell CouchDB about persistent replication jobs that should > always be running. > > For push replication there is no longpoll on the database changes. > Instead, you'll only see a failure if one of the individual requests > totally fails (10 times, with exponential backoff, I think it comes > out to around 10-15 minutes of disconnection before it'll die). > > Looks like Dave answered the rest of your questions. Welcome aboard. >