Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 59792 invoked from network); 22 Jul 2008 21:25:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 21:25:02 -0000 Received: (qmail 94015 invoked by uid 500); 22 Jul 2008 21:25:00 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 93992 invoked by uid 500); 22 Jul 2008 21:25:00 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 93981 invoked by uid 99); 22 Jul 2008 21:25:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 14:25:00 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.46.153] (HELO yw-out-1718.google.com) (74.125.46.153) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 21:24:05 +0000 Received: by yw-out-1718.google.com with SMTP id 5so931311ywr.0 for ; Tue, 22 Jul 2008 14:24:26 -0700 (PDT) Received: by 10.150.206.1 with SMTP id d1mr6075655ybg.144.1216761866151; Tue, 22 Jul 2008 14:24:26 -0700 (PDT) Received: by 10.150.206.2 with HTTP; Tue, 22 Jul 2008 14:24:26 -0700 (PDT) Message-ID: Date: Tue, 22 Jul 2008 14:24:26 -0700 From: "Nick Gerakines" To: couchdb-user@incubator.apache.org Subject: Re: Selectively keeping revisions around In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4E69EB4B-8914-4F9C-AD2F-D68649F91153@mubble.net> X-Virus-Checked: Checked by ClamAV on apache.org The use-case that I had in mind was a wiki document. You've got a blurb for the content and then a bunch of tuples representing meta-data. When user A comes around and edits the wiki page the document the new and old versions are both kept around for historical purposes. Being able to revert a document for one reason or another is important. The example that I'm envisioning doesn't really use old versions for any sort of lookups or indexing so saving them as attachments will do. # Nick Gerakines On Tue, Jul 22, 2008 at 1:50 PM, Jan Lehnardt wrote: > > On Jul 22, 2008, at 19:22 , Kurt Mackey wrote: > >> I'm admittedly pretty new to CouchDB, but I'm having a tough time figuring >> out how to use the document revisions it keeps around. As I understand it, >> PUTs replace what's there, leaving what's there in a deleted state until you >> compact the database, at which point it goes away forever. >> >> So given that (and correct me if I got it wrong), what's the best way of >> keeping revisions around forever? I have a number of documents that will be >> changed quite frequently, and I'd like to get at their history, provide >> diffs against it, etc. Is anyone doing this? > > Sorry to disappoint you. > > Do not rely on the revisions for what you want to do. > Only go with the no-compaction route if you have > very little data. > > To keep documents around you can do two things: > 1) Save old revisions as attachments to the most > recent revision. > 2) Save old revisions as new documents. > > Both come with advantages and disadvantages and > both seem clumsy in the light of possibly using the > built in revision system. We'd like to have the revision > system work as you want to use it, but getting it right > with the distributed replication is kinda tricky, so we > don't do that as of yet and you should not rely on it. > > 1) Advantages > All data is available under a single doc id. > > 1) Disadvantages > You need to copy around revisions manually. > Can't use the structure of your old revisions in views. > > 2) Advantages > You can use your old revisions in views. > You can use view to collect a doc and all revisions > (see http://www.cmlenz.net/archives/2007/10/couchdb-joins) > > 2) Disadvantages > Data is spread over multiple doc ids. > > (There might be more, I'm kinda short on time at the moment, > fill in the blanks please :) > > Cheers > Jan > -- > >