Roland Bouman sent me an email yesterday alerting me to an idea presented by Giuseppe Maxia on the MySQL Stored Procedures forum a couple days ago. The idea, in a nutshell, is to create a repository or library of tuned and tested MySQL stored procedures, similar to something like CPAN for Perl modules.
Frankly, I think it’s a great idea. A project like this, given a good head of steam, would propel the movement of MySQL 5 into the mainstream and encourage hosting companies and others to adopt the newer technology. If there is enough demand for this kind of thing (which I think there would be, considering both the hype about MySQL 5 and the communities on the web alrady set up for other RDBMS vendors who support stored procedures) it will force the hand of laggardly hosts who are still running MySQL 3.23.
Of course, that’s not the only reason why such a project would be a great idea. Among other things, it would promote a set of standards for writing procedures, would encourage newbies to taker a look through the work of more experienced developers, provide a central location from which one could find utility procedures so they don’t have to reinvent the wheel, and would be a breeding ground for bug discovery and feature requests for functions and procedures (which would push MySQL to add functionality to the existing stored procedure code infrastructure).
This last point is critical, for there are still a couple things I think MySQL must implement in stored procedures before they are widely adopted. First and foremost would be an easier and more manageable error/exception handling and checking within procedures. Second would be the performance optimization of storing compiled execution plans for procedures to reduce the overhead associated with parsing the stored procedure. I could envision these changes being made more rapidly with the support of a large community of testers drawing from a central procedure bank…
Let me know your thoughts,