On 24 Feb 2009, at 21:27, Stefan Karpinski wrote: > It seems awkward to have to name your databases (external) so that the > directory structure of the storage system (interal) is happy. Would > it not > make sense for couchdb to automatically store databases in a tree to > avoid > this concern? SHA1 hashing the name of the database and then using > the first > k letters of the hex hash value would make a lot of sense. That > would allow > database names to contain anything you want without having to worry > about > whether the filesystem allows those characters, and it's inherently > case > insensitive. It also would automatically balance the number of items > in each > directory. It would also create a non-obvious mapping of databases on the filesystem to databases through the HTTP API (poor admins!). Antony Blakey proposed a patch to make database look like <7bit-ascii-slug>- which would adress the "anything" issue, but he never finished it. But this (and your proposal as well) would still be open for putting everything in /a/b/c if you craft your db name's hashes to start with "abc". I like the /-trick. If there's further discussion on this, it should happen on dev@. Thanks. Cheers Jan -- > > On Tue, Feb 24, 2009 at 7:12 AM, Jan Lehnardt wrote: > >> >> On 24 Feb 2009, at 15:03, Sho Fukamachi wrote: >> >> >>> On 21/02/2009, at 10:40 AM, Jan Lehnardt wrote: >>> >>> Many. For certain applications it makes sense to have a db per user. >>>> >>> >>> Careful with that approach if there is any chance of having a lot of >>> users, or you don't control the machine. All the database files go >>> into one >>> directory. >>> >>> Personally I consider the "too many files in one directory" hype >>> to be a >>> little overdone but still wouldn't want more than a few thousand, >>> and if >>> you're not root, I've seen low limits set by quota systems as well >>> which >>> could be an issue in managed environments. >>> >>> Just something to bear in mind ... >>> >> >> >> Quoting http://wiki.apache.org/couchdb/HTTP_database_API >> >> All database files are stored in a single directory on the file >> system. If >> your database includes a / CouchDB will create a sub-directory >> structure in >> the database directory. That is, a database named his/her, the >> database file >> will be available at $dbdir/his/her.couch. This is useful when you >> a large >> number of databases and your file system does not like that. >> >> Cheers >> Jan >> -- >> >>