Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Worried about Tie::DBI

by Sinister (Friar)
on Nov 15, 2001 at 15:22 UTC ( [id://125549]=perlquestion: print w/replies, xml ) Need Help??

Sinister has asked for the wisdom of the Perl Monks concerning the following question:

Hi all!

For my VOICE project (see homenode::Sinister) I am using Tie::DBI. It seems very wonderfull, just tie a hash to a DB, even though I think tie-ing is bad... No SQL statements what so ever... Just plain old paradise

But where is the snake, with the apple? What is the down side of this cute little module? What could bite me, if I am going to a higher demand then "SELECT", "UPDATE" and "DELETE"...

I am worried about this - could anyone tell me what to fear?

Thanks!

Sinister greetings.
"With tying hashes you can do everything God and Larry have forbidden" -- Johan Vromans - YAPC::Europe 2001
perldoc -q $_

Replies are listed 'Best First'.
Re: Worried about Tie::DBI
by MZSanford (Curate) on Nov 15, 2001 at 16:11 UTC
    Interface wise, i would not be terribly worried about this. I mean, the DBM modules have been tieing hashes to "databases" all along. I can see feeling un-easy tho.

    My major concern would be speed as compared to SQL. If each UPDATE, SELECT, INSERT or DELETE is a single statement handle, there could be some major amounts of waste. If, there is a single statement handle, it maybe a bit better. I see no fundumental problem with <code lang="perl">Tie</code>'ing, but i would suggest testing some of the following under Benchmark

    • hash slices , do they work ? (if you tie,you make the next deveoper not need to understand it is a database)
    • speed of insert versus SQL insert
    • use of key with mis-matched datatype (does it die ? can you supply a handler ?)

    these are just a few, but , i have never used the module, and all of these maybe coverd by a quick look through the perldoc, or some quick code trolling. I find i ask better (read as simpler) questions when i have yet to look at the code.
    i had a memory leak once, and it ruined my favorite shirt.
Re: Worried about Tie::DBI
by mpeppler (Vicar) on Nov 16, 2001 at 01:20 UTC
    I just downloaded the Tie::DBI module to take a look before commenting, and it looks pretty cool.
    It probably works fine, although Lincoln does mention a fairly significant speed penalty over plain DBI.

    Personally I'd use the regular DBI syntax, mostly for maintainability, and because it clearly exposes what SQL statements are going to get executed - if you ever need to find out why a certain part of your app is performing slowly then this is really a necessity. Another thing that I don't think it does is JOIN queries, and that's another thing that you're likely going to need if you go beyond a very simple app.

    Just my $0.02, of course :-)

    Michael

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://125549]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found