Why I Like DB2

I cannot for the life of me figure out why people use MySQL when they have DB2 to choose from.

  • DB2 is free for 1 core and 1GB of I/O buffer and as much data as you want. 99% of the websites in the world could run just fine on free DB2.
  • The workgroup version (64GB of I/O buffer) works great in the cloud.
  • For your development system, that means you can make a copy of the production database and run it just fine on your laptop.
  • If you’re doing data analysis, you’re probably doing a table scan anyways, which means you can use free DB2 to analyze production data.
  • When you start making money, the non-free DB2 is half the cost of Oracle, and IBM DB2 support people are actually trained and useful.
  • IBM invented SQL. They also invented transactions. DB2 is incredibly well architected.
  • DB2 has “SQL Skinning” where DB2 can pretend to be other databases, like say, MySQL.
  • The free version all the way up to the enterprise version is the same database. Really. Exact same codebase, just more things turned on.
  • DB2 is practically self-administrating. That is, running the DB2 installer sets up DB2 for your machine.
  • DB2 has all these automated things that tune your database as it runs.
  • For the non-automated case, “Runstats” scans your database and computes statistics on your tables which the query engine can use to optimize queries, “reorg” rearranges your data to be faster based on those statistics. If you cluster on the right foreign keys, DB2 will locate related data together when it can, so your data will load faster because all related data will be already in RAM most of the time.
  • It took me literally 5 minutes to setup a redundant backup database server (High Availability Disaster Recovery in IBM speak).
  • The HADR database allows reads, so you can run things from your primary, do ETL from the backup to a free DB2 instance for a datawarehouse, and run your reports from that third database.

There are two bad things about DB2

  • IBM’s customers are the government and big companies. So their documentation reads like the instructions for the 1040 form, rather than the more informal style people in Silicon Valley use. It took me awhile to figure out “Bufferpool” meant “disk cache”.
  • The MacOSX version is out of date.

1 comment for “Why I Like DB2

Leave a Reply