On 31/12/2008, at 1:18 PM, Chris Anderson wrote:

On Tue, Dec 30, 2008 at 5:34 PM, Antony Blakey <[email protected] > wrote:

I'm looking for feedback on the canonical/derived containment issue, the idea of having a defined directory for _externals to store data, and the idea of putting said directory/ies into the dbinfo call (and hence also each
_external request).


So we're looking for something like (modified the dir structure so
that derived data is easily symlinked/configed to another drive):

my-favorite-db-6c38ab2b68f86d2c9.couch/
  name
  data

my-favorite-db-6c38ab2b68f86d2c9.indexes/
   views/
      my-design-doc-8ab2b68f866c3d2c9.view/
         name
         data
      my-other-design-doc-c3d2c98ab2b68f866.view/
         name
         data
   my-external-indexer/
       ...
       whatever
       ...
   my-other-external/
       ...

where  _external scripts can choose whatever non-conflicting directory
name they'd like, within the derived data part. (and store it however
they'd like...)

OK, but putting each external dir into the top level namespace opens the possibility of collision should couch want to put something else into the indexes directory. Maybe that directory should be _view/, with an API rule that names with a leading '_' are reserved :)

Also with the added optimization that when slug == the db name we
don't add the hash to the dirname.

I'm not sure about the db-info call's details (obviously externals
need the information, but we might not want to send it to http
clients...)


An external may also want to munge an arbitrary name using the same algorithm (it may be driven by multiple design docs). IMO an RPC-like HTTP endpoint that munges a name would be sufficient. How about dbinfo providing the munged form of it's indexes directory name i.e. the leaf, not the path. The _external can already get the indexes directory from the /_config request, presuming that /_config is available to the external - #168 should be resolved if the external is going to be responsible for constructing the directory. Failing that, the external can be given a directory to use on it's invocation command line, but it will still want to be able to munge names.

Consider yourself approved for landing. The work you have so far at
http://github.com/AntonyBlakey/couchdb/tree/escaped_filenames seems
sane, so it's just a matter of polishing it.

Will do.

Antony Blakey
--------------------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Lack of will power has caused more failure than lack of intelligence or ability.
 -- Flower A. Newhouse

Reply via email to