Thoughts on using MySQL plugins

I’m giving thoughts on the viability of MySQL plugins. This is due to a particular experience I’ve had, which is thankfully solved. However, it left some bitter taste in my mouth.

MySQL plugins are a tricky business. To create a plugin, you must compile it against the MySQL version you wish the users to use it with. Theoretically, you should compile it against any existing MySQL version, minors as well (I’m not sure whether it may sometimes or most times work across minor versions).

But, most important, you must adapt your plugin to major versions.

Another option for plugin makers, is to actually not recompile it, but rather provide with the source code, and let the end user compile it with her own MySQL version. But here, too, the code must be compatible with whatever changes the new MySQL version may have.

And if it doesn’t compile with the new MySQL version?

That’s what happened to me. The particular case at hand was SphinxSE, a plugin which serves as a bridge between MySQL and a Sphinx Search server. I’ve been using it for years and was happy about it. But, as it happened, it took well over a year for sphinx to compile with MySQL 5,5. This meant I was unable to upgrade my 5.1 installation to 5.5, a thing I was aiming to do for quite a while.

Even when fixed, not all features were included, and thankfully I was able to come up with my own patch.

Not complaining about this particular project — I think Sphinx is awesome, with latest versions providing great features I’m putting into immediate use.

However, how much am I willing to rely on 3rd party projects when planning my MySQL upgrades? I’m now thinking I shouldn’t.

A central repository?

MariaDB does a great thing: it provides with several additional features over standard MySQL, including a set of plugins. They turn into a debian-like repository, in which they maintain the plugins for their own distribution.

[Darn! I just realized I should have looked at what they did with Sphinx in their 5.5 distribution! Need to do my monthly mental examination.]

Anyway, this is something I would like to see outside MariaDB as well: a central repository where plugins are maintained and kept up to the latest releases.

Thoughts, anyone?

5 thoughts on “Thoughts on using MySQL plugins

  1. This is something that is done very well in other projects. Apache and Perl come to mind – they have different packages….so a repo like MariaDB has is useful.

  2. I’m reminded of the EXTENSIVE MediaWiki plugin library. They aren’t necessarily maintained, but meta-info tells you which was the last version they were known to work with, which lets you be a better chooser. Also, if it’s important enough to you, you can patch to a new version and post your changes for others.

    On the other hand, it suffers from “branchitis.” I made extensive enhancements to a MySQL plugin, and someone else LATER made extensive enhancements and ignored mine — now we have “version wars…”

  3. This is one of the major benefits of MariaDB. Unfortunately until now they didn’t have anything for MySQL 5.5, so you were out of luck anyway, but the idea of including as much stuff as possible into the same installation is certainly great.

  4. Not being familiar with the coding of plugins, is there a reason why there are not interfaces or standard APIs that can be exposed to a plugin to allow it to be upwardly compatible rather than combined at the compiler hip? This has been an issue for a long time, and it seems like a compatibility API layer is needed.

  5. “MySQL plugins are a tricky business. To create a plugin, you must compile it against the MySQL version you wish the users to use it with.”

    It actually depends on what the plugin is using. If it only makes use of the plugin API, a single binary should work fine across a given major version. Problem is that larger (and more useful) plugins usually rely on server internals, which can change at any given version.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.