From user-return-18716-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Mon Nov 7 09:52:22 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3438F71C8 for ; Mon, 7 Nov 2011 09:52:22 +0000 (UTC) Received: (qmail 24201 invoked by uid 500); 7 Nov 2011 09:52:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 24151 invoked by uid 500); 7 Nov 2011 09:52:19 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 24143 invoked by uid 99); 7 Nov 2011 09:52:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 09:52:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andres.orencio@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 09:52:14 +0000 Received: by eyg5 with SMTP id 5so4053238eyg.11 for ; Mon, 07 Nov 2011 01:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=gOiJFBQSJk6sTPIDFKoNMyrkEQPSiUJ8jhf/0L0L7xg=; b=dlmDSj1OLvtm7jDEzK8yodUcdIIE/jIsoBQpFq0Mjk488dLCnL6F8icZfgF5wHc1I8 3cMXwBriYVjnG9dWJldhC9rhxQawtdxTK0xntArdpN2LjnB4exIRblex65BnGWfXgwvR 1EYjZHhxbMIMDjhY5fBbPkIfegiFr9ehzZuI4= Received: by 10.14.20.16 with SMTP id o16mr295080eeo.41.1320659513194; Mon, 07 Nov 2011 01:51:53 -0800 (PST) MIME-Version: 1.0 Sender: andres.orencio@gmail.com Received: by 10.14.95.140 with HTTP; Mon, 7 Nov 2011 01:51:12 -0800 (PST) In-Reply-To: References: From: =?ISO-8859-1?Q?couchdb_=2D_Andr=E9s_Orencio_=2D_lodopidolo?= Date: Mon, 7 Nov 2011 10:51:12 +0100 X-Google-Sender-Auth: 3mp3bFzizWgJdUd0kI0VhbqRnwU Message-ID: Subject: Re: Best way to model historical data To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6d589e02738eb04b1220170 --0016e6d589e02738eb04b1220170 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What you propose is to have a document initially and any other future changes as new document parts (of the original document), those reference to the previous document parts until the initially document. Is this correct? But it has a problem to construct the document to the last state because must read all documents changes and apply all to the original document. A view could do it? What do you think? 2011/11/2 Alexander Shorin > Hi, > > "Each document represents some completed state(event - it just was as > it is and history couldn't be changes) and doesn't affected from > external data" - start from this point(; To reduce document size you > may include related document _id and all vital fields that shouldn't > be changed in time for it. > > Another approach is keeping references both to _id and _rev of related > document, but all would be broken if someone runs database compaction > (also this method doesn't works for views). > > -- > ,,,^..^,,, > > > > On Wed, Nov 2, 2011 at 2:20 PM, couchdb - Andr=E9s Orencio - lodopidolo > wrote: > > Hello. I'm new in couchdb. > > > > I have some questions but I'm going to put them in separate threads. > > > > For this, I want ask you which is the better way to store documents and > its > > historical states. > > > > For example, I have products documents and categories documents. Produc= ts > > has one or more categories. This "relation" may change in the time, and > > product characteristics can change to. > > > > I want to store all document changes (categories too). > > > > Which is the better way to do this? > > > > Thanks you. > > > --0016e6d589e02738eb04b1220170--