Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 64548 invoked from network); 1 Mar 2010 15:46:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Mar 2010 15:46:10 -0000 Received: (qmail 47994 invoked by uid 500); 1 Mar 2010 15:46:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 47809 invoked by uid 500); 1 Mar 2010 15:46:08 -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 47801 invoked by uid 99); 1 Mar 2010 15:46:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Mar 2010 15:46:08 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.68.5.9] (HELO relay00.pair.com) (209.68.5.9) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 01 Mar 2010 15:45:59 +0000 Received: (qmail 98315 invoked from network); 1 Mar 2010 15:45:36 -0000 Received: from 69.181.72.204 (HELO ?10.0.1.10?) (69.181.72.204) by relay00.pair.com with SMTP; 1 Mar 2010 15:45:36 -0000 X-pair-Authenticated: 69.181.72.204 Subject: Re: /_all_dbs and security Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Damien Katz In-Reply-To: <20100301094000.GA4798@uk.tiscali.com> Date: Mon, 1 Mar 2010 07:45:36 -0800 Cc: fdmanana@gmail.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <7C5AB910-A94E-411A-8D81-0E5C33F28FEB@gmail.com> <5AAAEEB4-828A-4D56-A4D5-AF4DA84A26F2@gmail.com> <20100301094000.GA4798@uk.tiscali.com> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.1077) X-Virus-Checked: Checked by ClamAV on apache.org I don't think end users need a list of dbs they can access on the = server. Think the simplest answer is to only support _all_dbs operation = for admins and be done. -Damien On Mar 1, 2010, at 1:40 AM, Brian Candler wrote: > On Mon, Mar 01, 2010 at 09:55:46AM +0100, Filipe David Manana wrote: >>> The reason for no storing _security as a doc is an optimization. So = we >>> extend that optimization, and have something like a = security_changed event >>> for a db, that the _dbs database can react to. The model isn't = different >>> from subscribing to _changes, it'd just be a separate code path. >>=20 >> That's a good idea (both simple and more efficient). >>=20 >> The only issues left are the cases where the user adds a new DB file >> (possibly coming from other server for e.g.) into the DB dir, deletes = a DB >> file or replaces a DB file with an old version (a backup whose update = seq >> number is from the past). > ... >> Do you think this would add too much overhead or it could be a = somewhat >> "light" approach? Or better, do you have a better idea for it? >=20 > Just as an idea, you could just turn this on its head. Suppose _dbs = was the > primary source of information; then the _security record within the = database > is just a cached copy of that. It's easy enough to take a _changes = feed > from _dbs to update this cache. >=20 > But in that case, the cache would be better kept in RAM, rather than = within > the database file. >=20 > After all, CouchDB already keeps a cache of open database filehandles, > doesn't it? So you could read the security information from a regular > document (an "expensive" operation) when you open the database, and = then > just continue to use that version thereafter. You'd invalidate the = cache if > the corresponding _dbs object is updated. >=20 > However this leaves the following issue: what if the database file is > renamed on disk, or disk-copied to a different system which happens to = have > an existing _dbs entry for that name? >=20 > I think the best solution is for the _dbs database to be indexed by = uuid.=20 > But to make this work efficiently, the database file *on disk* should = also > be named by its uuid, rather than the database name. That's probably = too > big a change to swallow at this stage. >=20 > But it does have some other side benefits (such as being able to = "rename" a > database instantly without touching the filesystem, and being able to > automatically spread a large number of databases across directories = without > forcing the user to use database names like 00/xxx, 01/yyy, 02/zzz = etc) >=20 > Regards, >=20 > Brian.