Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 50173 invoked from network); 22 Jul 2008 20:58:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 20:58:19 -0000 Received: (qmail 57797 invoked by uid 500); 22 Jul 2008 20:58:19 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 57497 invoked by uid 500); 22 Jul 2008 20:58:18 -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 57486 invoked by uid 99); 22 Jul 2008 20:58:18 -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 13:58:18 -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 [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 20:57:21 +0000 Received: from [10.10.29.95] (ip131.fa1-0-1.occ.iinet.com [::ffff:198.145.32.131]) (AUTH: LOGIN jan, SSL: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Tue, 22 Jul 2008 20:51:40 +0000 Message-Id: From: Jan Lehnardt To: couchdb-user@incubator.apache.org In-Reply-To: <4E69EB4B-8914-4F9C-AD2F-D68649F91153@mubble.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Subject: Re: Selectively keeping revisions around Date: Tue, 22 Jul 2008 21:50:25 +0100 References: <4E69EB4B-8914-4F9C-AD2F-D68649F91153@mubble.net> X-Mailer: Apple Mail (2.928.1) X-Virus-Checked: Checked by ClamAV on apache.org 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 --