See Also: Home Links Personal Site Blogroll  FriendFeed CV

Tags:

Topic Image

Reflecting On Class::Dbi

This presentation ay OSDC 2006 was by Stephen Edmonds , one of the members of the Monash University web team, and concerned their use and impressions of Class::DBI. Having just recently used this module myself I was interested to hear about other peoples experience with it, especially given the environment the presenter works in is uncanningly similar to my own workplace.

The environment the team work in is mostly Perl for CGI and webapps, but PL/SQL and Oracle as their corporate back end. The project being discussed was one where they were to build a data repository to act as a bridge between data from their student records, LDAP, course planning and membership data sources (some in XML feeds).

Initially they had a dozen or so tables and a relatively simple schema but had a short timeframe to deliver the service (basically between semesters) so after some research (this was about 3 years ago I beleive) decided that the best option was a database abstraction providing library like Class::DBI.

Things went well in development until they encountered the 1st issue which was that Class::DBI wouldnt play nicely with their corporate standard for primary/id field naming conventions, their workaround was to provide some sort of *glob like accessor method for their usual field name as an alias of the usual id field Class::DBI expects.

They also had a couple of performance issues with the script when doing the scheduled update of student and staff data (some 90,000 records) where the 90,000 sequential SQL updates made the runtime unnaceptedly long, this was a function of Class::DBIs lack of optimisation when emulating relational table support. There was another issue whereby it seemed library loading order was being upset under certain conditions and debugging Class::DBI proved to be difficult.

At this stage they decided that rather than tweak Class::DBi they would build their own Class::DBI like layer focused on their schema needs and with support for passing things like paramaters that could be used to track system or user names performing data updates (for historical/auditing reasons). This turned out to be quite some effort but has resulted in a library which meets their needs and has continued to do so for over 2 years now without problems.

Some of the limitations of Class:DBI have since been met by the more recent DBIx::Class which the developer said he would use in preference, however if they were to repeat a project of this nature again and had to make a decision about whether to use a vanilla library vs build-their-own he said it would be a tough call, but seemed to lean towards the use-existing-library approach and customise it if needed.


See Also: OSDC 2006 | Perl | Web Development | Notes Index