couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <>
Subject Re: Adding vs replicating documents
Date Fri, 08 Jun 2012 08:38:38 GMT
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
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
need to be transferred. That's likely a simplistic summary but will do for


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message