mod_mysql

October 3rd, 2004, By Duncan Gough

For about the fifth time since I started my first project I’ve written yet another web framework.

I looked at CMS alternatives, wiki’s and Blogging software but nothing provided the flexibility I wanted (and I don’t want a lot, but a login system and an advanced user preferences section were key).

So, I don’t mind writing these frameworks. The fundamentals are fun to code but then the dreaded forms appear. Creation and validation of forms is always tedious and I’m not about to start using a massively overweight OO form validation and rules based creation system that’s just about as bad as some of the templating systems that are around now.

It’s at this point that I’m always reminded of the BREAD acronym. So many websites I’ve used or coded are just that – simple BRowse, Edit, Add or Delete web apps. Yet there are so many different ways of doing it – rewrite everything back to the base url vs. quick and dirty procedural code vs. a simple OO system vs. a full-blown rule processing systems.

Almost all of these solutions are going to use Perl, PHP or Python as the scripting language and MySQL as the database. With the expection of mod_perl, mod_python, the growing interest in PHP frameworks and the continuing attempt to build the complete forms-handling-as-a-fat-client-web-app, it still feels like a competition to re-write that kind of J2EE/EJB Java approach that gives Java it’s stronghold in the business programming market. I like Perl, PHP and Python because they are *high* level programming languages and in these instances, they’re just wrapper code for manipulating a database. So let’s go the distance, mod_mysql could replace the scripting, mod_rewrite could make sure everything was RESTful so all I’d need to do is create the templates and add in the appropriate loops for the inevitable lists and arrays dumped in these by the output from mod_mysql. Configurable via .htaccess just like mod_rewrite is. That would sew up about 60% of the web apps out there.

I just want to configure mod_mysql to use these templates over here, to display this data in here, validate all form data according to the relevant database table definitions and let me handle anything else with an simple, extensible system (which is where the scripting languages can come back in).

Of course, the hardest thing in all of this is acceptance – getting mod_mysql installed in anywhere near enough shared hosting environments would be difficult *but* for the fact that these very same ISPs will soon be looking to upgrade to PHP5 and MySQL 4.x, maybe even MySQL5.

Laziness and hubris it may be, but I’ve had enough of handling forms.

« Time vs. EffortVirgil, quick, come see, there goes Robert E. Lee. »