Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 16058 invoked from network); 8 Apr 2010 17:54:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Apr 2010 17:54:20 -0000 Received: (qmail 4127 invoked by uid 500); 8 Apr 2010 17:54:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3947 invoked by uid 500); 8 Apr 2010 17:54: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 3939 invoked by uid 99); 8 Apr 2010 17:54:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Apr 2010 17:54:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of faust451@gmail.com designates 209.85.221.184 as permitted sender) Received: from [209.85.221.184] (HELO mail-qy0-f184.google.com) (209.85.221.184) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Apr 2010 17:54:12 +0000 Received: by qyk14 with SMTP id 14so2587593qyk.14 for ; Thu, 08 Apr 2010 10:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=oVhNEMBisETyvbYlmkct+Iqt8r8KzIuY8gP7ZQ/DsJM=; b=bisK5bnWTv4s/ti/XS9FozvTizanbl6upx4A8IkM4/5MsXpLVxuq8Os3XhCd4gLwQM xT6ip6rUJbBrvGncJblJQdVkAhZGfwq9lyKuOo2SAj+Dn4W+bkECOeFJRDPQ1Sz3hPuE ALTKc4NEn/bBtusHlN7LYf9RT5xysgglPII6g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZxqYYZU/oTaxX2ZgT8r7R4wI6Q8TS7pA9dVJmwei8Ks8sVYepnh6navwQgDAMu5eO4 eyE1i4Y56842clHjOJIHl04LaGiLTWaqRkDXECAA6HyXvDWxrrOMBhH2uadowq5U9M9c yCM6VU+udotXlHn+rmzZ5c4xrG7HOjFh1sHwM= MIME-Version: 1.0 Received: by 10.229.238.82 with HTTP; Thu, 8 Apr 2010 10:53:48 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Apr 2010 21:53:48 +0400 Received: by 10.229.238.70 with SMTP id kr6mr629267qcb.49.1270749228720; Thu, 08 Apr 2010 10:53:48 -0700 (PDT) Message-ID: Subject: Re: About denormalization and keep consistent From: faust 1111 To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org What difference? if do Author after_save if name_changed? Content.by_author(self).each {|content| content.author_name =3D self.name; content.save(bulk=3Dtrue) } or i start backend process to track Author _changes. This code not guarantee that all contents will updated. 2010/4/8 Andrew Melo : > On Thu, Apr 8, 2010 at 12:29 PM, faust 1111 wrote: >> I can catch changes in my app before save author, may be backend >> process is surplus in my case. >> i need consistent, when i update author name i must know that all >> contents with author was updated success. > > Then their suggestion of watching _changes works for you. Start > watching _changes. Make all your changes to the documents' authors. > Any changes that come through on _changes, make sure they have the > proper author. Keep watching _changes until you're sure that nobody > has stale data they're waiting submit. > > >> >> >> 2010/4/8 Zachary Zolton : >>> I suggest you check out the _changes API: >>> http://books.couchdb.org/relax/reference/change-notifications >>> >>> Basically, if you have doc types A & B, where B maintains a denormed >>> bit of A, then you can watch the _changes feed in a backend process. >>> When an A gets updated, hit a view of all B's related to that >>> particular A, and update the dernomed data. >>> >>> On Thu, Apr 8, 2010 at 10:20 AM, faust 1111 wrote: >>>> Hi guy's >>>> I return back to my problem with denormalization. >>>> >>>> is it possible to keep consistent when apply denormalization? >>>> For example >>>> Content >>>> =A0 have author (we store author name and id in Content) >>>> >>>> When author name changed(that's happens not frequently) >>>> i need find all content belong to this author and update author name >>>> but what if this operation not finished (not all docs was updated) >>>> >>>> What i can do in this case? >>>> Thanks. >>>> >>> >> > > > > -- > -- > Andrew Melo >