couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Ringo <>
Subject Attachments and replication
Date Thu, 19 Jan 2012 01:52:34 GMT
Hi all,

Assuming I have a document with an attachment and some fields, and that 
this document has been replicated between source and target servers.

    "_id": "551ffd9dc43cb73c257628d8a31e9e1f",
    "_rev": "4-387d5d23b62e398421bddb10e16e740f",
    "foo": "bar",
    "baz": "quux",
    "published": false,
    "_attachments": {
        "photo.jpg": {
            "content_type": "image/jpeg",
            "revpos": 2,
            "digest": "md5-iOKjYGKWzEmEtMaqmYCtlA==",
            "length": 3622469,
            "stub": true

Let's say I change one of the fields on the source server; say "foo": 
"bar" to "foo": "bar2". I then do a pull replication.

Sniffing the packets, it seems to me the entire document is replicated, 
including attachments. I was under the impression couchdb would be able 
to replicate the document independently of the attachments.

In other words couchdb would transfer just the "text/json" portion of 
the document and not the attachment, i.e. less than ~1 kbyte vs. a few 
megebytes in this case.

My experience seems to contradict my assumption. It looks like the 
digest and revpos fields are used for this, as mentioned here:

Is there something I am missing or perhaps a configuration option I am 
not setting properly?


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