I've got a friend in the Haiku Project http://www.haiku-os.org/ and I
often wonder what's to be learned/gained from their BeFS code/system. It
(as you may know) looks a lot like CouchDB...but flipped (binary/text
*is* the thing stored, attributes are the extras).
Every file can have "unlimited" attributes, those attributes can contain
"anything" (including binary content, iirc), and they're all query-able
via those attributes:
http://www.haiku-os.org/docs/userguide/en/attributes.html
They even have a nifty little DSL and included UI for building it:
http://www.haiku-os.org/docs/userguide/en/queries.html
Example search for "MAIL" documents:
(((((MAIL:from=="*[cC][lL][aA][rR][aA] [bB][oO][tT][tT][eE][rR][sS]*")
&&(MAIL:when>=%2 months%))
&&(MAIL:subject=="*[vV][iI][bB][rR][aA][pP][hH][oO][nN][eE]*"))
||(MAIL:subject=="*[sS][kK][eE][pP][tT][iI][cC][aA][lL][iI][tT][yY]*"))
&&(BEOS:TYPE=="text/x-email"))
Which matches the query more read-ably seen in this screenshot:
http://www.haiku-os.org/docs/userguide/en/images/queries-images/query-window-filled.png
It's also able to save these as "templates" for later use and
customization (think "Views").
Anyhow, BFS (or BeFS is Linux land...due to Boot FS claiming the letters
earlier) has been eating my brain since I tried BeOS back when Be, Inc.
was still shipping free CDs. :) It's likely partly responsible for
why/how I found CouchDB and why I was in love with XML databases (mostly
eXist) prior to that.
Oh, also, if you've not read this (and you're into filesystems and
databases), you should check out this PDF:
https://www.haiku-os.org/legacy-docs/practical-file-system-design.pdf
It's an oldie but a goodie. :)
Thanks, all,
Benjamin