The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Changing the structure

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Changing the structure Posted: Jun 10, 2005 8:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Changing the structure
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

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.

Read: Changing the structure

Topic: Sun's fuzzy math Previous Topic   Next Topic Topic: Fixed Enclosure Handler

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use