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 59B8C115A4 for ; Fri, 16 May 2014 22:51:44 +0000 (UTC) Received: (qmail 64164 invoked by uid 500); 16 May 2014 11:19:08 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18982 invoked by uid 500); 16 May 2014 11:05:04 -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 79530 invoked by uid 99); 16 May 2014 10:50:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 10:50:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.154.70.127] (HELO demeter.yrnm.net) (195.154.70.127) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 08:16:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=yrnm.net; s=oscar; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:To:MIME-Version:From:Date:Message-ID; bh=YuNhktnBBO6BExi1RmgiKZ6AUyTO6AHQ4Nf6/AV8bx4=; b=Fz5L85kjt85pgT0Nj/hGiTY34inlkn/zuklJfvUWuOT6g3FQ/N/7pGv8pBaAcC/cdI4QdoLosHEI5dVTI2/iyyeNFY0sUAHtOhtV0VTiP75W9q50UWtxaM+W/zZuLQfzGKPNOalkAczrWbuGm8KPuqIrk3TOzhJoVNPW4hrt7yo=; Received: from [151.52.233.111] (helo=sheeva.yrnm.net) by demeter.yrnm.net with esmtp (Exim 4.80) (envelope-from ) id 1WlDJI-0007sG-BY for user@couchdb.apache.org; Fri, 16 May 2014 10:16:08 +0200 Received: from [192.168.0.4] (helo=xanthus.yrnm.net) by sheeva.yrnm.net with esmtp (Exim 4.72) (envelope-from ) id 1WlDJB-0001Ts-VH for user@couchdb.apache.org; Fri, 16 May 2014 10:16:01 +0200 Received: from localhost ([127.0.0.1]) by xanthus.yrnm.net with esmtp (Exim 4.76) (envelope-from ) id 1WlDJ6-0005Zb-7t for user@couchdb.apache.org; Fri, 16 May 2014 10:15:56 +0200 Message-ID: <5375C93B.3070209@nospam.yrnm.net> Date: Fri, 16 May 2014 10:15:55 +0200 From: Franck Eyraud User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Are these in Plugin scope? References: <266B09EF-0542-47E8-9CEE-8E6B068559E5@utt.fr> In-Reply-To: <266B09EF-0542-47E8-9CEE-8E6B068559E5@utt.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 13/05/2014 22:30, Aurélien Bénel a écrit : > Hi Suraj, > >> 1. Audit keeping: set a mandatory (potentially configurable) field in each >> doc with the UserCtx.name and Date/Time. (like, "last_modified_time" = >> current_time and "last_modified_by" = UserCtx.name). >> 2. Audit trail: whenever docs are created/updated, also write another >> "snapshot" doc for history keeping. > I might have misunderstood what you wanted to achieve but couldn't you do that with a simple update handler? Interesting question; can the list confirm these statements : 1. can be done with a simple update handler 2. cannot because it requires the creation of an extra doc (since couchdb revisions can not be considered for history keeping, one of the reason is that they don't survive replication) This plugin subject seems very interesting to me, but it is unfortunately not very discussed in the mailing list. Le 13/05/2014 14:29, Suraj Kumar a écrit : > From what I understand, plugins work at the HTTP layer only and not at the > DB layer. It is almost true, except that you can also plug in in the authentication layer. I suppose that allowing the plugins to intervene at the dB layer would complicate much the db engine as trust would not be the same; but the plugin system is currently quite new, and might evolve. > Are these two features in Plugin scope? Currently from what I know (but I'm a mere user that looked as you did), yes they are out of scope. > If not, what is the "right" way of > doing this? (Two options I see: 1. introduce a middle ware layer 2. > continue to hack couchdb-erlang code and maintain it ourselves*). Any other > options? One another solution might be some extra services listening for changes (in node.js for example), and making the desired modifications. Franck