Puakma: Under the hood

I'm Brendon Upson, jack-of-all-trades, master of one or two. I'm talking about life running a small ISV tackling business issues and leaping technology hurdles in a single bound.

webWise Network Consultants is based in Sydney, Australia and develops the groundbreaking Tornado Server technology.

Oil prices

Filed under: by Brendon Upson on 2007-07-26

There is so much anger about oil prices and how much we pay for fuel. What about the prices we pay at the supermarket for other liquids? Let's take beverages for example.

Unleaded petrol is currently around $1.30 per litre. Coca Cola in a 1.5litre bottle costs $2.15 (www.colesonline.com.au) which is $1.43 per litre. Water. Good old drinking water is $3.04 (1 litre Mt Franklin Still Water - ok there are cheaper alternatives) per litre.

Sooooo. To:

  1. Travel to the other side of the planet
  2. Engage some heavey machinery to drill through the earth's crust
  3. Pump out dead dinosaurs
  4. Put the fluid on a boat
  5. Transport it back to the other side of the world
  6. Distill the dead dinosaurs into various products
  7. Transport the distilled products to distributions centres

 Costs less than putting plain old water in a bottle. Our two big supermarket chains here in Australia are screwing this country.

Odd thought for the day....

Filed under: by Brendon Upson on 2007-07-25

Think about all the couples you know.

Some you think of as "Bob and Jill", others "Janet and Bill" (and yet others as "Janet and Jill" or "Bob and Bill" but I digress - same rules apply).

Why is it that you usually put one particular partner's name first?

If I were a Simpson

Filed under: by Brendon Upson on 2007-07-12

The new Simpson's movie website has some very cool technology: Design your own Simpson's character. If I lived in Springfield I'd look something like this....

Brendon J Simpson 

bj_simpson.jpg

Partial relational database backup and restore

Filed under: by Brendon Upson on 2007-07-11

I am currently working on a problem for a customer that involves the backup and restore of selective rows in a relational database. Not easy. The application in question requires selected rows in 38 tables (think: project, phases, milestones, resources, etc) to be exported to a file (about 20,000 table rows per export), then that same data imported as a NEW dataset. That last bit is tricky and I'll explain why later. 

The export.

Built into Tornado is a class called pmaSerial which basically turns a JDBC ResultSet into a lump of XML. So the export is quite easy, just need to make sure we export the data in the correct order, eg parent tables first, followed by children. The result is a compressed xml file - actually the same basic format as .pmx (used to export Tornado apps).

The import.

The import is much more of a challenge. We use Tornado's XMLImportParser which does most of the heavy lifting. When we import a row, we need to generate a NEW PRIMARY KEY so that the imported data is added as an addition to any data that might be in the database already. Of course once a new primary key for a row is generated all the child rows of that table break because they refer to a primary key that no longer exists (or worse, the imported rows are connected to existing rows in another project). To get around this a map of translated keys is kept and each time just prior to row insertion, the foreign keys in the row are transposed.

The good news is it works well, and between different database types (eg postgresql to mysql), the bad is it is sloooooow. And the testing is not fun :-(