Wednesday, July 04, 2007

Code: Productionisation of FAME

One of the first questions I ask when interviewing developers is "How many systems have you put into production?". There's a big difference between writing a system and productionising a system; perhaps that's why I'm so fascinated by logging (probably the dullest subject on the planet) as a mechanism for forensically diagnosing production problems and, potentially, a mechanism for measuring application service level, latency and security events - but that's for another post or two.

Here's some real production code from a long long time ago written for a bank that no longer exists:

http://enhyper.com/svn/src/fame/fmUtilLib

It's the maintenance script for a production installation of FAME and it has some interesting hooks and shell programming techniques. There's an example of the use of a Zeller function, the algorithm I pinched from Joe Celko's SQL for Smarties book and turned it into a bc(1) function - which I think is pretty neat. There's also a hook into a command line call to a program which generated an snmp trap to alert support in case of error.

IMHO all production support scripts should be written in straightforward bourne shell, just like the operating system scripts - there's a good reason scripts are written in the lowest common demoninator. In the old days, disk space was limited and fancy shells were not standard installations. Same for editors - emacs had an amusing nickname back then - "Eight Megs And Continually Swaps" - back in the days when 32MB of memory was a big deal.

2 comments:

Steve Ford said...

I'm glad to hear that you have a healthy respect for logging in a production system. I'm planning on publishing some debugging code I wrote long ago and still use. I could put it on your SVN server if you like.

P.S. - three cheers for Bourn scripts!

Graeme Burnett said...

Steve, it would be a pleasure to host the code on enhyper. Email it over and I'll put it up this weekend.