August 29, 2008

Motormouths Anonymous

Hello, my name is Robert and I am a recovering motormouth...

Spare a thought for those of use who are born with verbal diarrhea, we have to work very hard not to monopolize any conversation and are typically very uncomfortable with silence.

My whole family seem to be motormouths, some recovering like me, other just keep talking. My father was famous in the family, he was late in learning to talk and my paternal grandmother was convinced that he was spending the rest of his life making up for lost time.

I have it largely under control. Every now and then I catch myself talking too much and deliberately stop talking. I can have actual conversations with people and learn things from them. A few things make me go off the wagon - I had a concussion recently and a friend had to put up with me talking non-stop for 4 hours straight. More everyday, I find myself having to avoid caffeine, a cup of coffee and I am off and 'talking for England'.

Being a motormouth has its advantages, to be one you have to have a brain capable of keeping up but on balance the disadvantages are too great.

August 26, 2008

Distributed Transactions

One of the hardest things to design in distributed systems is the transactional behaviour.

I am perpetually surprised at the naivety with which people approach this set of problems. There does not seem to be any formalism to approaching this kind of design. What I do is deliberately take as step back and design the 'transactional architecture':
  1. Identify parts of the architecture that may participate in distributed transactions; components with storage that will be changed irrevocably as a result of a transaction. The obvious ones are databases and message queues which are themselves transactionally aware but one must also take into account non-transactional components such as the file systems and LDAP servers that may be changed in the scope of a transaction.
  2. Document the expected transactional behaviours involving these components.
  3. Design transactional schemes that meet the expected behaviours.
At each step I revisit the designs of the system based.
  1. Should I really be changing this component? I may stop using the file system for storage and instead move it into a database table.
  2. Does the expected transactional behaviour introduce circular dependencies between components? Is ACID-ity expected between two widely divergent transactional domains?  I may move whole entities from one component to another.
  3. If there is no way to implement the behaviour can I make some change to produce the same business behaviour but avoid the implementation problems.
In general I believe that using two-phase commits (XA and the like) is the sign of a poorly designed solution architecture as they are only necessary if the system requires 'immediate' consistency between two or more transactional domains. I will use other transactional management techniques such as idempotency and compensating transactions which provide 'eventual' consistency not 'immediate'.

August 03, 2008

Carbon-neutral foods

The biggest problem with modern food production is that it is entirely dependent on oil. We've already seen food costs rise as a direct response to rising oil prices.

Many farmers have profitably moved their food production over to organic methods, I wonder how long it will be before we see certified carbon-neutral foods on our supermarket shelves?

I'd certainly be happy to pay a premium initially in the sure and certain knowledge that as oil runs low my food prices will remain stable.

I can see that there would be degrees of carbon-neutrality. The foods that still use oil, but are carbon-offset, the foods that use no oil in production and the farms that use no oil in production or distribution.

All plants should be fertilised using non-oil derived fertilisers. The by-products of plants such as the unused stems and leaves should be put into bio-reactors to produce fuel or fertiliser. All farm animals should be fed on carbon neutral food stuffs and their by-products should be recycled for fuel or fertiliser.

A collective of farms could work together: One specialising in producing plants for food and fertiliser, another producing fuels and yet another producing meat, fuels and fertiliser. Each farm would work to offset the others' needs.

I don't know when this will happen, I only know that it will have to happen.