24
Jul 07

Mechanism, not Policy

Over on Diamond Notes, a somewhat skeptical take on the recent Postgres benchmarks news. Can’t say I agree with it, and I did comment on it, but something did go click for me while thinking about it, hence this entry. See, the problem isn’t just performance. MySQL just doesn’t do the right thing.

I mean, I can understand the principle of implementing the smallest featureset you think a user would need and then optimising the bejaysus out of it – Epiphany would be a better browser than Firefox for 90% of the time for me because of that approach (it’s just Epiphany’s way of doing bookmarks that gets in the way) because Epiphany is always faster and less of a memory hog than Firefox since it doesn’t try to do everything. Emacs and vi is another example – sure emacs can do just about anything, but vi starts in a heartbeat and if you just want to add one line to your .muttrc/aliases, there’s not much point in firing up emacs. Of course, if you’re doing a chunk of work… but that’s another story.

The point was, before the digression, while MySQL was faster than Postgres in previous benchmarks, it wasn’t doing the job right. Sure, it was faster… but only if you wrote your SQL the MySQL way. Don’t use JOINs because MySQL doesn’t do those well. Yes, I know, there are better ways to do things than JOINs (and if you grok set theory, easier ways), but forcing end users to write SQL a certain way – and punishment with poor performance is forcing them – is the same as putting policy in the kernel. It violates one of the core tenets of unix kernel philosophy: Mechanism, not Policy.

There was also the point that MySQL didn’t really do SQL. I mean, transactions. Obvious example, I know, and everyone and her aunt has commented on it, so no need here beyond the usual “come on” response to the “oh, but you don’t need transactions” line. You might be right that there are other ways to do things, but guess what? That’s my choice as the developer, not yours. That’s the entire point to SQL – it lets me abstract away from the actual storage policy and just worry about the arrangement of the data in tables. In other words, it’s a Mechanism for me to implement my Policy with. And that’s a very powerful thing. But MySQL didn’t fully implement that Policy and it implements some parts of it more favorably than others, thus imposing it’s Policy on me through what’s meant to be an impartial Mechanism.

And yes, I know, Postgres adds to the SQL standard with its OO features. But that’s not the same thing. Adding to the standard is fine – so long as you implement the standard first.
So frankly, seeing Postgres doing so well in the performance benchmarks isn’t just a nice sight from the point of view of performance – it’s a nice sight from the point of view of doing the right thing. It means that the last thing that was holding back the better way of doing things has now  been taken away. LAPP stacks? About time too!


20
Jul 07

m2bz

I guess there’s irony in this, but less than a fortnight after submitting some code to mantisBT, I’m now trying to update a perl migration script (m2bz, by Julian Mehnle) to handle a migration from Mantis 1.0.3 to Bugzilla 3.0 (currently it works from Mantis 0.17.5 to Bugzilla 2.16.3).

I know, it’s no great hunk of coding, but I thought it was worth a grin.

(I should point out, by the way, that this isn’t because Mantis is bad software, it’s just that the time tracking chunk of Bugzilla is better than that of Mantis right now, and that’s something that’s required at the moment. There are other features in Bugzilla that are nice bits of icing as well, but the time tracking’s the main thing.)


20
Jul 07

HTML 5

Hmmm. One of the fun things when a client specifies W3C html compliance as a requirement is that you can spend a surprising amount of time picking just what W3C standard they want you to comply with in the first place. And now it seems that there’ll be another one to choose from. HTML 5 has just been revived as a standard in development, as a reaction to CSS and XHTML. Which means that at some point in the future, you’re going to have CSS 3, XHTML 2.0 and HTML 5 out there.

Daniel has a good summary of the whys and what’s involved. Some of the new features look downright spiffy – DOM support improved (right about the time that PHP is pushing away from DOM to get to SimpleXML – doh…), improved support for Forms (native data validation and better native input controls look like good timesavers to me), and more content tags (article, dialog, video, canvas and progress were listed).

As Daniel says though, this is still a standard in draft form; meaning we’re years from mainstream implementation yet. Pity some parts are already out of date so, but then again, I can’t see someone using old hardware thinking too kindly on the idea of upgrading everything because of a new version of software that can probably be abused just as badly as the last few versions to produce whatever the HTML5 version of the blink tag will be.