Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 53597 invoked from network); 8 Apr 2009 11:06:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2009 11:06:25 -0000 Received: (qmail 8883 invoked by uid 500); 8 Apr 2009 11:06:25 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 8807 invoked by uid 500); 8 Apr 2009 11:06:25 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 8796 invoked by uid 99); 8 Apr 2009 11:06:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2009 11:06:25 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.142.185] (HELO ti-out-0910.google.com) (209.85.142.185) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2009 11:06:15 +0000 Received: by ti-out-0910.google.com with SMTP id u5so70558tia.3 for ; Wed, 08 Apr 2009 04:05:52 -0700 (PDT) Received: by 10.110.28.15 with SMTP id b15mr1624884tib.4.1239188751625; Wed, 08 Apr 2009 04:05:51 -0700 (PDT) Received: from gera-laptop ([203.192.238.211]) by mx.google.com with ESMTPS id j5sm79957tid.21.2009.04.08.04.05.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Apr 2009 04:05:50 -0700 (PDT) Received: by gera-laptop (Postfix, from userid 1000) id C1AFA2D7F2; Wed, 8 Apr 2009 16:35:46 +0530 (IST) Date: Wed, 8 Apr 2009 16:35:46 +0530 From: Devendra Gera To: dev@couchdb.apache.org Subject: Document update notifications Message-ID: <20090408110546.GA26996@gera-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Checked: Checked by ClamAV on apache.org Hi, This is my first message to this mailing list. Please direct me to the right place if this isn't it. We are planning to use CouchDB as a central store for objects which also need to be pushed to various nodes. These nodes get the objects, work on them and then update them at the central store again. The distribution and nodes is being handled by a queueing solution. In order to achieve a single-step publish process, I wanted a hook into CouchDB whenever a document is created, updated or deleted. The hook would then push the object into the queue. Also, when a document changes (we look at a particular "status" field, but it could be any change), we wanted a hook to send out a notification to a destination specified within the object. I looked at the "update_notification" hook and while it was interesting, it did not allow me to see the actual change in the document. So I went ahead and implemented a "doc_update_notification" which is extremely similar to the update_notification, but sends the old as well as the new doc as part of the notification. Note that it sends *only* bodies by design. The patch for 0.9 is available at : http://www.theoldmonk.net/couchdb_docnotifications.0.9.patch And the patch for 0.8.1 is available at : http://www.theoldmonk.net/couchdb_docnotifications.0.8.1.patch The patches are small and simple. I would appreciate any comments. I suppose the doc update notifications should be No-Ops if one does not want them. Right now, for example, a doc delete would always result in a doc retrieval because it has to be sent in a notification. This is true even when one doesn't have doc update notifications enabled. If someone is interested, I will work towards making that possible, making it a generic solution. Thanks, --gera.