When I first created this blog server (back in 2002), the basic server structure differed a fair bit. I've been evolving the code (mostly without having to restart the server) over time, and I'm about to make another such change - to the storage mechanism. The running implementation now dumps every blog item into one directory (per blog). So, every post I've ever made sits in a file somewhere in the same directory (one file per day). At some point, that's going to be a problem in terms of the file system. So, I've made a small change - underneath the basic storage directory are per-year directories, and each post just drops into that directory. The cool thing is, that change required only three small method changes - I'd refactored the storage code awhile back, so it was simple.
Harder is the fact of the existing server, it's caches, etc. Once I made the simple code change, I had to get the server updated - files relocated and caches updated. Moving the files was easy, because they are named based on date: a file named vw_blog13-5-5.blg is from the 13th of May, 2005. Quick work to rearrange all of that. Then there's the caches - for quick lookup, there are a few caches that needed updating - for instance, the category cache:
blogs := (BlogSaver default keys) asOrderedCollection.
blogs do: [:each |
| blog |
blog := BlogSaver named: each.
blog cache setupSearchCategoryCache].
Another short script of the same sort for the keyword cache, and it's done. I'll convert the server to this new structure sometime this weekend, and the cool part is, no one should notice the change.