On Wed, Oct 1, 2014 at 4:02 PM, Brian Mitchell <[email protected]> wrote:
> 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. > Thanks for the confirmation. That's what I was suspecting, but wasn't sure. > Attachments are identified by name and can be replaced without mutating > old references to documents with attachments of > the same name. > This is where you lose me a little. How can I have multiple references to the same attachment? Am I not able to have 2 documents with 2 distinct attachments with the same name? For example, if each user uploads a "photo.jpg" that is attached to their profile? Or are you referring to the ability to retrieve an older rev of the document and retrieve the older rev of the attachment? For example, in rev1 of a doc I attach photo.jpg and in rev2 I update the photo.jpg. Do you mean I can still retrieve rev1 and the original photo.jpg? Thanks, Eric > 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 > >
