The attachment will be stored once and each revision will retain a reference to that attachment (including when it was added, called revpos, so replication should be efficient too). Compaction will copy the attachments over and should retain a single copy for each unique attachment.
Attachments are identified by name and can be replaced without mutating old references to documents with attachments of the same name. If you pass the _attachments section and leave out stubs for any existing attachments, that is interpreted as a delete. Brian. > On Oct 1, 2014, at 3:53 PM, Eric B <[email protected]> wrote: > > Given that attachments are seemingly stored as key/value pairs within a > document, does that mean that each revision of a document contains the > attachments as well? Or are they stored independently? > > For instance, given a 5kb document with a 100Mb attachment that has 10 revs > (where the attachment was added in rev 1), will the total storage > requirements be 5kb * 10 + 100Mb or (5kb + 10Mb) * 10? > > Thanks, > > Eric
