December 18, 2008

Functional Filesystems

[Warning: this post is technical and possibly boring!]

There is this idea I've been playing with for quite some time. In IS I often see this tendency to create big, obnoxious databases for storing information. But sometimes we don't need to do this. I have this idea where you simply store information in a predetermined file structure. Then, the code navigates, reads, and interprets this file structure.

For example, I currently have a project where I'm generating a set of html files via local command line php script (I have no server-side scripting). In order to create a new page all I have to do is place a content snippet in a certain folder. The php then knows knows to generate it, and add it to the navigation sidebar in a sub-level navigation section based upon the sub-level directory the file is in. Take a look at http://www.cmu.edu/gelfand-center/scimodules/.

Pinch of Salt also uses a form of this concept. When uploading pictures to a recipe, the picture is stored in a folder based on the recipe's id, which is inside a folder based on the user's id. While Pinch of Salt does use a database to store the location of pictures (it needs to store other things too, unfortunately), the idea is that it may be useful the be able to simply query a folder for it's contents. Or perhaps recursively delete a user's folder if an account needs to be destroyed.

I'm sure this is not original, but that doesn't make it any less interesting.

No comments: