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 D7EC611910 for ; Tue, 13 May 2014 17:56:46 +0000 (UTC) Received: (qmail 68675 invoked by uid 500); 13 May 2014 12:30:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 68429 invoked by uid 500); 13 May 2014 12:30:06 -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 68238 invoked by uid 99); 13 May 2014 12:30:06 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2014 12:30:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of suraj.kumar@inmobi.com designates 209.85.223.182 as permitted sender) Received: from [209.85.223.182] (HELO mail-ie0-f182.google.com) (209.85.223.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2014 12:30:03 +0000 Received: by mail-ie0-f182.google.com with SMTP id tp5so218905ieb.27 for ; Tue, 13 May 2014 05:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inmobi.com; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=VXBa6MLwYrRkr4C1Q9sej3RRVzkB5ja8IGv8jd+WYes=; b=f/lrQvMJDs/HtZcVsnWv+EuFcW6yz9HdIrhzWddrPvYZKxy97evgvHXWr4oJVwnpVo ZHfkdmDEEWv0tfltSzWUqwzjVfrFMxGxWGGdmNthjh8cY0pkZ64w551PzDlQTAMiLpyT sooA3R9r2CMTFkp56qER0FXQGEhBzamhoHqLo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=VXBa6MLwYrRkr4C1Q9sej3RRVzkB5ja8IGv8jd+WYes=; b=HWc4MeK8tXeX/PSaGDSjoFXUut+KCimQ45YuA5JDoZTvwnv5basjP48jI/n0dd8zbq uML2tYkKYxTnpO/i3IKdm6Vkt70MpEI6+Qq+LqlPFsfifx/0xkJzr8mv081Pe/ug+3KG pJuwNK5ia4773I7W847yS1BXMA/cxzEk6sNrZl0l/Fev942J30aiTBuGBe/l2YF8P4rK Kv/OprfdrOz5lamfEqlqnZFD1m3BziIOZoP9gBEHlMZvem6qGeXW/A8KBZ3OrI9pT3zc Q9qqodOtYbmMt9TYmMtu98yRcO/KrYtbd/Ldg/OeFSw95Mdg2RxjmhvI7+Aa02CdQlk/ UJtQ== X-Gm-Message-State: ALoCoQlBGQdP7MdVhP4XYupr1VrbEmV5uy36guXoaV9+9bNafcwBSmffXDbyvfvia4b+AWMXj8SU5tMk0GpanjMNJtsonF2kfm6Hl4F8natCHgoo/vpSqKo= MIME-Version: 1.0 X-Received: by 10.50.22.210 with SMTP id g18mr56262985igf.19.1399984179201; Tue, 13 May 2014 05:29:39 -0700 (PDT) Received: by 10.64.15.197 with HTTP; Tue, 13 May 2014 05:29:39 -0700 (PDT) Date: Tue, 13 May 2014 17:59:39 +0530 Message-ID: Subject: Are these in Plugin scope? From: Suraj Kumar To: "dev@couchdb.apache.org" , user@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7bd752a8b1745404f94737f9 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd752a8b1745404f94737f9 Content-Type: text/plain; charset=UTF-8 [cross-posted] Hi, We have hacked couchdb erlang code to make it do some low-level things we wanted for our system. The changes are: 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. >From what I understand, plugins work at the HTTP layer only and not at the DB layer. Am I right? It appears like a way to introduce new API end-points than to affect behaviour of existing (core) APIs. We don't want to intercept every write API call (PUT, POST, various update handler functions, etc.,). Nor do we want to tell clients to do the ugly thing of "duplicating the very information in the doc which they provide at HTTP layer" (ie., HTTP basic auth). Are these two features in Plugin 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? Cheers, -Suraj * It seems to me, option #2 is still *cheaper* than inventing a "highly available and scalable middle ware layer". -- An Onion is the Onion skin and the Onion under the skin until the Onion Skin without any Onion underneath. -- _____________________________________________________________ The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. The firm is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. --047d7bd752a8b1745404f94737f9--