-------- Original Message --------
Subject: Re: Not embedding SQL in perl
Date: Wed, 01 Aug 2001 15:56:00 -0400
From: kyle dawkins <[EMAIL PROTECTED]>
To: Henrik Edlund <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>



Henrik Edlund wrote:

>And while we are discussing "not cutting corners", those who still use
>MySQL should switch to a real DBMS before they even think of abstracting
>the SQL away from their Perl code.
>
>That people still use MySQL really shows how many lusers there are with
>computers that try to develop real software. I said _try_.
>
>*sigh*
>

Henrik

Not sure if you're aware of it, but that argument is pretty old.  We're 
onto a much more interesting, new argument now. :-)

Seriously though, you're right, MySQL is not a "real" RDBMS.  No 
transactions, no foreign key constraints, no stored procedures.  It is, 
however, free, and in use in a lot of places.  And interestingly enough, 
in a way that makes the current argument even MORE important; writing 
SQL into your code (as per the current thread of discussion) will make 
it exponentially more difficult for you to move to a "real" RDBMS as 
Henrik urges you to.  If you abstract DB access into a middleware layer, 
you will have a much, much easier time.   By placing SQL into your 
application code, you are removing the flexibility of changing your 
persistence mechanism at a later date.  And believe it or not, that's 
not as uncommon as you might think.

I cite the example of wwwthreads here... it's a great BBS, runs under 
mod_perl, is fast, and has a DB backend.  However, the source is 
LITTERED with SQL, and everywhere there's a line of SQL, the dude has to 
put an "if" conditional around it to check if the installation is using 
MySQL or something else, because MySQL has numerous features that are 
not found elsewhere (last inserted id, REPLACE command, LIMIT m,n)... 
 so, twice the number of SQL statements in code that (in my opinion) 
should not have any SQL in it at all...

It's all food for thought (I hope).

Kyle
Software Engineer
Central Park Software
http://www.centralparksoftware.com




Reply via email to