Thursday, 29 August 2013

Which MySQL Version to Use, and Why?

Quite often in my career as a Database Administrator I was faced with the responsibility of choosing which MySQL version for a project, or asked to upgrade an existing MySQL instance to this-and-that version.

Professionally, I tend to search for a balance between stability (nobody likes a database that keeps crashing and losing data) and performance (if you're running a website, a faster database will have a positive impact on your profit).

The balance can be tricky to achieve, as performance is something that usually comes in newer versions (as any Agile Development practitioner would be delighted to confirm you), with the development team receiving feedback and getting a better grip on the problem; while stability comes with age (as Eric S. Raymond wisely stated: "given enough eyeballs, all bugs are shallow").

To get the best of both worlds I choose to run the oldest MySQL branch still being maintained (as of this writing, MySQL 5.1 is my MySQL release of choice) while trying my best to keep the minor version as up-to-date as possible, in an attempt to still benefit from performance improvements and bug-fixes back-ported to the release (which in turn takes me to 5.1.69).

Please keep in mind that upgrading is always a risk and will by definition cause instability on your production systems. I strongly advise sticking to your MySQL version for as long as possible, and only upgrading when forced out of your comfortable position by discontinuation of maintenance (which I consider a bigger risk than not upgrading, in the long-run) or when hitting bugs for which there are no work-arounds.

The main advantage of this strategy is that most (if not all) the bugs you will find are known, well-documented, and will have known fixes or work-arounds. The main disadvantage is that you will be missing quite a bit of novelty, and your life will sound kind of boring. Your developers will hate you for the missing features, but you will enjoy a comfortable position with management for the added stability.

What MySQL version are you running, and why?