Saturday, April 21, 2007

Transactions and cars

I was on vacation a couple of weeks ago, SCUBA diving in Lanzarote. Had a great time and didn't think about work once. However, on the way home we were shuttled to the airport in a mini-bus and my mind started to wander back to work. JBossTS 4.2.3 will be the default transaction manager in JBossAS 4.2 and as a result we've been having some interesting discussions with clients about the impact this will have on them. I've written before about why transactions are needed and why this necessitates recovery and durability. However, there are still times when I feel that an everyday analogy may make things easier to explain to people, particularly those who aren't as immersed in transaction principles.

So there I was in the mini-bus and I began to think: cars are something almost everyone knows about and probably interacts with on a daily basis in one form or another. Therefore, is there something in the architecture of a car that plays a similar role to transactions in that you take it for granted, probably don't even think about it, maybe don't use as often as you really should, reckon you can do without because you rarely (if ever) see the need, and yet if it wasn't there you'd regret it and in all likelihood never go without it again? These things are often easier to write about in retrospect, because the list I just gave took me about 20 minutes to forumlate during that trip back to the airport.

There may be more than one answer, but the one I came up with seems fairly obvious: the seat belt! Unless you live in a country that mandates wearing of seatbelts, you may not wear them often, if at all. Even if you do wear them, how many times have you really tested that they work the way they should? You just expect them to. (Most of the people in our mini-bus were not wearing their seatbelts.)

Of course in many countries there are laws that define the safety characteristics of seatbelts, so they should work well enough. But what if there were no such laws, or you lived somewhere they didn't exist, or the manufacturer decided to cut corners? (Can you say: transactions without recovery?) Because accidents (failures) don't happen all that often, the vast majority of the time you (and the vast majority of people) wouldn't care about defective or sub-standard implementations. But when the time comes for them to work and work well enough to protect your life (or critical data), that's when you would complain if they didn't (assuming you survive). You wouldn't complain at having to pay for more saftey features within your car (or mini-bus) or any slight overhead such things may incur. So why complain about adding transactions and recovery?

I haven't tried this analogy yet with any of our customers, but it'll be interesting to see if it makes it easier to explain the differences between the old and new transaction implementations provided by JBossAS.
Post a Comment