Why do I always do this? I’ve made such great progress with Inklog and then I stop because I become frustrated with the outcome.
I really like Blosxom‘s method of keeping everything in the file system. It’s easy to use, easy to edit, and easy to backup. And, after careful consideration, I decided that many aspects of Inklog would work like Blosxom.
All of the various nodes are defined in the file system. All of the templates sit in the file system. All of the configuration information is in the filesystem. And they are all directory based and since the web is URI based, which easily translates to directories, it just makes sense. All the “static pages” would be served from the file system. Images would come from the file system. Comments would be stored in the file system. Everything… in the file system. Then I started to adapt this philosophy to weblogging. Under this philosophy, weblog entries should be in the file system too. I had planned an incredibly innovative method for retrieving files that would allow ANY type of content to be uploaded and displayed accurately. It was so incredibly easy and just made so much sense. However, then I started to think it through, and ran into problems.
First of all, every file has to have a unique name in a directory. Those are the rules of a filesystem. A lot of my entries would fall into the simple category labelled “life”. Additionally, a lot of my entries don’t really have a single subject. So a filename, in that case, isn’t that important. However, I have to make sure it’s unique. Using untitled.txt more than once wasn’t going to cut it, and incrementing a number on the end of the word “untitled” wasn’t going to work either. However, that’s something that can be worked around.
I also wanted a way to get an entry into multiple “nodes” or “categories”. Perhaps I post an entry to “photography”, but, since the photograph is humorous, I’d like it to also be listed under “funny”. I figured I could just use a symlink and have Inklog detect these properly. But then I realized I’d like to be able to list all the categories a particular entry was in, and that means recursing the entire filesystem to find them.
Another problem arises when you consider my migration from Movable Type. I’d like to be able to import all of my entries into one category called “uncategorized” and then move them into proper categories as time permits. However, if I move them, the “PermaLink” changes, and that should never happen. Additionally, what if, in the future, I were to re-categorize everything. Again all the permalinks would change. This means I need a place to put the entries permanently. I thought that perhaps I could implement a directory called “2003″ and in it one called “03″ and it in one called “20″ and that would be the permanent location of this entry. That seems to work okay as long as I don’t ever desire to change the date of an entry, which would be pretty rare.
Text searching becomes another problem. I’d have to “grep” all the files in all of the directories to get a list of entries that contained a certain piece of text. Additionally, finding a list of the newest entries would also require this same recursion of the entire directory structure. And, while this can be done fairly quickly, I’m sure it’s not nearly as fast as hitting an RDBMS, though I really haven’t done any testing.
When you consider all of these problems, and their half-baked solutions, it just seems to make more sense to stuff the entries into a database and handle them that way. Of course now you lose all the flexibility of being able to store things in the filesystem. Additionally, it breaks a few of the innovative concepts I had planned for Inklog. For instance, I thought it would be very nice to be able to simply upload a JPEG file to a directory and have Inklog decide how it should be displayed as an entry. Additionally, the display portion for a JPEG would look for a file with the same name but an extension of .jpginfo to find caption information to go along with the image. This means that the database now has to allow multiple uploads per “node”, and that just gets confusing. And then, what if I simply want to include an image inline in an entry? Where do I put it so that Inklog wont decide it’s an item of its own? In the filesystem where it might be mistaken for a node? In the database with some other notation to indicate it shouldn’t be counted as a node? It just gets too confusing. And confusing is the last thing I want Inklog to be.
So I’m stuck. And that frustrates me.
Can you help? Do you have any ideas? Is there something I’m overlooking? Do you use Blosxom? How do you work around these problems?