[ciapug] Re: Re: MySQL 5 Stored Procedures (correction)

Tony Bibbs tony at tonybibbs.com
Mon Jul 10 16:40:22 CDT 2006


Given how popular database portability is, I fail to see the real 
usefulness of SP's if you really want to maintain portability.  Sure, 
most abstraction layers allow you to call SP's on the server, but more 
than not, the crap inside the SP is DBMS specific.  Therefore, my view 
is that if you are using ADODB, PEAR::DB, Creole or PDO then you should 
really limit the SP's you want to use.  Here at work we only use SP's as 
a last resort when we have some serious performance issues...which 
hardly ever happens.

To top that off, as soon as you use SQL in your code you run the risk of 
breaking your portability because many developers fail to write portal 
SQL.  That's why you have persistence tools like Propel which get aim to 
limit how much actual SQL the developer has to write (plus it gives you 
that clean data tier you are after).

Now, if you are using the native PHP driver (e.g. mysql or mysqli) and 
you know you'll never change DBMS's, write all the SP's you want.  Just 
my take...

--Tony

Carl Olsen wrote:
> I got quite a lot of criticism from my coworkers at my last job for trying
> new things.  Obviously, you don't need an end loader when a shovel will do
> the job, so maybe it was fair criticism.  To solve the problem, I moved on
> to a new position.  I can understand a company that produces a lot of web
> sites wanting to keep things simple.  I love programming and I'm always
> trying the latest tools and programming techniques.  I like the way that
> stored procedures and prepared statements handle data.  I much prefer to
> write a data tier that separates my data layer from my presentation layer.
> Once I have parameterized functions, I can change the data layer without
> changing any of the pages that use the functions.  Not everyone is
> interested in rapidly moving to new technologies (particularly a company
> that already has a large body of legacy code), but those of who are should
> be entitled to our opinions.  I'm in a situation now where I don't have any
> legacy code to deal with.  I'm creating it all from scratch, so I'm laying a
> foundation that will be easy for me to work with in the future.


More information about the ciapug mailing list