Saturday, November 04, 2006

An honest comparison of databases

Most people who compare databases have an axe to grind, and a fairly jaundiced view of the opposition (insert MS/IBM links here). If they’re not employed by the company that makes the thing, then usually there’s a terrible prejudice engendered by only ever using the one database, and therefore believing the other one to be rubbish just because it’s different. (This was neatly summarised on Usenet a long time ago, although there’s an obvious counterpoint to the idea that you’ll prefer that which you’re most familiar with*). Now, nobody can honestly claim to be independent, but I do have at least a few reasons to justify having opinions that aren’t solely the product of hard cash or only ever using one system.

In my life, there’s been heartache and pain. As well as that, I’ve used Access 97, 2000 (settle down, I know they’re not ‘really’ databases), SQL Server 7, 2000, 2005, Informix 8, postgresql, mySQL and DB2 UDB 8 and 9. About the only thing I haven’t touched is Oracle, and that’s mainly because it seemed too common; one of the great things about programming for Informix is you always seem to be able to say “If we had Oracle, this would work much better” and get away with it, rather than actually bothering to optimise your application.

So why DB2? Well, when I finished smoking crack**, it seemed like the thing to do. Plus I’d never used it, it turned out to be marginally cheaper than SQL Server, and at the time my curmudgeonly IT team kept telling me that you couldn’t run PHP with SQL Server, because it wasn’t Open Source.***

I used it for three years, I didn’t ever get to play in a WW2 tank like IBM promised me, and in total I got a cup of black coffee and two ballpoint pens as bribes. These were all long after the procurement procedure, so I don’t think they blighted my perspective.

A few things that are different between Microsoft and IBM
Tablespaces – designed to upset people by being one extra thing to think about, and most people don’t like thinking. Microsoft do the decent thing and hide it away somewhere, so it never bothers you. But don’t forget Douglas Adams’ maxim: The only difference between something that can go wrong, and something that can’t go wrong, is that when the latter does go wrong, it’s harder to fix.
Schemas Likewise. If you never had them, it’s a frightful pain to encounter them. But if you have had them, and then you find you don’t get the ability to divide up your database by purpose of tables, views, etc, without ReallyLongNamingConventions, you tend to miss them.
CaSE sEnsItIvIty DB2 is case sensitive on table names, in certain scenarios. This is rather annoying. mySQL seems to always be case sensitive, and SQL Server doesn’t care. But on the other hand, DB2 is always case sensitive when it comes to the contents of a column, and the other two don’t seem to be. And to be honest, that’s more annoying: MR JOHN SMITH is not how Mr John Smith wants to be addressed, thank you very much. Opinion and coding practice will imply for you whether you’ll be more annoyed by DB2 or SQL Server.
DTS workflow I like tools where you can easily drag and drop tasks and build relationships between them. I like SQL Server for this. I heavily resent DB2 for making me handcode a lot more of this.
Chaining tasks in DB2 But I also like the way that DB2 is good at having tasks trigger other tasks, in more complicated ways than the success/failure/anyway that SQL Server implements within DTS.

More as it comes to me, or if anybody makes a helpful suggestion. A lot of these differences boil down to nothing works out of the box vs nothing ever gets better than it was out of the box, but your mileage may vary.

* which might be called The DBA’s Lament: “I may be more experienced with ugly women, but I still prefer beautiful ones”
** as in “hmm. That’s an interesting application. Say next week, me and the CEO are smoking crack, and we decide it has to run on DB2. Can you handle that?” – this always provokes interesting behaviour from salespeople. Try it some time.
*** Yes, I know. It just seemed a bit odd to be talking to ‘the database expert’ and have to teach them how to suck ODBC eggs, and I figured it was really political grief (it’s not politic to actually ask people to do any work) that was getting in the way of some Microsoft product.

0 comments:

Post a Comment