Creative programming with MySQL
By Giuseppe Maxia on May 01, 2008
Programming databases is tricky. If you need the basic access only, any programming language can do. But when you want to get some advanced feature, you face difficult choices. If you are lucky, the feature you are looking for is available in a library compatible with your language of choice. But usually it happens that you are writing in Java, and your life-saving routine is only available in Perl, or you are writing in PHP and striving for features that are buried deep into a Java class.
But it does not have to be that way. Sometimes, you can develop closer to the server, in such a way that any client, using any programming language, can access your extended routine.
MySQL, although not as equipped with built-in features like some competitors, is nonetheless particularly suited for such this kind of creative programming. Using the different engines available by default, you can combine features creatively.
For example, you can combine Federated tables and triggers to create conditional code. You can execute different triggers for the same event on the same table, depending on which federated table you call, or you can create cascaded triggers for one table.
A recent addition to MySQL flexibility is MySQL Proxy, a friendly helper that sits between client and server and allow you to change behavior or create new features on the fly.
This topic is quite vast, and I could speak for hours about that. As it happens, I will be speaking on this topic for one hour at CommunityOne. If you are around, come along, at 12:25, Esplanade 307.