On 8 June 2012 06:26, Luca Matteis <[email protected]> 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
