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 947859FCD for ; Fri, 8 Jun 2012 08:39:12 +0000 (UTC) Received: (qmail 30939 invoked by uid 500); 8 Jun 2012 08:39:11 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30619 invoked by uid 500); 8 Jun 2012 08:39:08 -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 30555 invoked by uid 99); 8 Jun 2012 08:39:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 08:39:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dave@muse.net.nz designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vb0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 08:38:59 +0000 Received: by vbzb23 with SMTP id b23so941229vbz.11 for ; Fri, 08 Jun 2012 01:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muse.net.nz; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=8FRVjaAAfwLcmFtWEa1OJ45DToXmblqv4UMIQPDA6Ro=; b=KlBa78UV8lc0alLDlQRJ7iHwt/QXghH1ATo0HQ2oQovOFp5lnNIxX0YG6zDbLmgbev MJ3JmyZv0ikq3UyVY3+nqvL2gzCx+osUnT5q9rMDFeXuz2EC4rF2IZgrwOQMeXQCY4n5 gdf71RbapJEy5NtL03HYpkWDI8XzJ89jXjpzM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=8FRVjaAAfwLcmFtWEa1OJ45DToXmblqv4UMIQPDA6Ro=; b=C0KycZItcp/nDBIpdwF8Db5JHdJ+NHpEq6ujtIWQQYs0yLrTpKFD5nCqb/WbbyLRgP UvmRP7BfUfX7B5rUeHqhzhT9VZRjMLU63RlN0hxTRVJrFva7t18tgWmlZe4KLFdFpXHX UrwUBjek664hUtkDspmCqbxltaeF4GFruQ8m5kwXz/s0BqcXZ7q+KRFrQmxA8+3LOB6P ex7fbVHTIJL8tyxpDhq5nP5kDn/Ir8EQ6SAT738bqcX1pKPAj66X8cBcOKgTEJod1tRF gVNy9WFPx9YRXj/R331YXPzuB9Ee5ddh7olAw2vn+7Fa8xTgGG7fKyrg+gHiyJ9hGJgo m0/A== MIME-Version: 1.0 Received: by 10.52.21.174 with SMTP id w14mr4565431vde.24.1339144718032; Fri, 08 Jun 2012 01:38:38 -0700 (PDT) Received: by 10.52.33.172 with HTTP; Fri, 8 Jun 2012 01:38:38 -0700 (PDT) X-Originating-IP: [84.112.19.176] In-Reply-To: References: Date: Fri, 8 Jun 2012 10:38:38 +0200 Message-ID: Subject: Re: Adding vs replicating documents From: Dave Cottlehuber To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf307ca538389fc404c1f1ed07 X-Gm-Message-State: ALoCoQmd9QhDcP+cpJkiW0v4kFa3+tWV+JwiH1zBd4xSganh5W07Hnpbzc0g62SaS4TjYChXmhHA --20cf307ca538389fc404c1f1ed07 Content-Type: text/plain; charset=ISO-8859-1 On 8 June 2012 06:26, Luca Matteis wrote: > Ok, say I install a local Couch that I upload my 1gb of data to. > Whenever a change is made to a JSON document in my file, my routine > will still have to go through all the records and update my local > Couch, which would result in the entire DB updating, therefore the > replication would need to transfer *everything* to my hosted Couch > once again. > > Continuous replication would be an obvious solution to this. If you need to intervene programmatically then sit on the _changes feed, keep track of the ids that change and then specify the URLs to replicate manually. This is covered on the wiki & in the guide also, you have the links by now :-) If your JSON docs are generated by script with ids, then you can simply regenerate them into your local couch (no need for replication) and the revs etc will all match up nicely with the remote end. Key misconceptions: #1 changes feed will allow you to find out changes since a given DB update. #2 replication does not transfer all documents, it compares docs and missing revs and makes smart decisions on what needs to be transferred. If a doc exists in the source but not in the destination, the whole of that doc *does* of course need to be transferred. That's likely a simplistic summary but will do for the moment. A+ Dave --20cf307ca538389fc404c1f1ed07--