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 59F6A9892 for ; Wed, 2 Nov 2011 11:58:20 +0000 (UTC) Received: (qmail 97742 invoked by uid 500); 2 Nov 2011 11:58:18 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97654 invoked by uid 500); 2 Nov 2011 11:58:18 -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 97638 invoked by uid 99); 2 Nov 2011 11:58:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 11:58:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kxepal@gmail.com designates 209.85.210.46 as permitted sender) Received: from [209.85.210.46] (HELO mail-pz0-f46.google.com) (209.85.210.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 11:58:12 +0000 Received: by pzk5 with SMTP id 5so128442pzk.5 for ; Wed, 02 Nov 2011 04:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=LBinG2Tg8Czaf0KJ07RAVtC0iYVk84Xwaoh1G+YQJUw=; b=MHCrGDAeV78o8zV1q7M+Aw4Rm7XuCfDilF4/fTR3pBZ4gDY/ir39DTqZCbyn4SRGJt kUI+GXP39vARlkBWpP7fBCGx4Fp+a3kcGtXa0LtzPQTUT5bS2vk6tfUAKO9HJDhRFfsg VBs8JLsv/2MpGV3s6unBGzcPJH6xR868tpoJ4= MIME-Version: 1.0 Received: by 10.68.73.6 with SMTP id h6mr4452461pbv.41.1320235071052; Wed, 02 Nov 2011 04:57:51 -0700 (PDT) Received: by 10.68.58.196 with HTTP; Wed, 2 Nov 2011 04:57:51 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Nov 2011 15:57:51 +0400 Message-ID: Subject: Re: Best way to model historical data From: Alexander Shorin To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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=C3=A9s 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 i= ts > historical states. > > For example, I have products documents and categories documents. Products > 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. >