in reply to Performance v's Maintainability

Well there's some things you shouldn't do using the database, like maintaining sessions. You really ought to use something like File::Cache or one of the Cache::Cache modules.

Do you do any forking? If not I say passing around a DBI handle is pretty dang reasonable. That way when you go to mod_perl, and use Apache::DBI (which you probably will), you get the performance benefit.

BTW: I like DBIx::DWIW ;)

update: When I say maintaining sessions, I don't mean maintaining some kind of database (like a playlist), I mean managing data that has a short lifespan, that's supposed to expire and go away.

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Performance v's Maintainability
by Ryszard (Priest) on Sep 22, 2002 at 13:48 UTC
    Well there's some things you shouldn't do using the database, like maintaining sessions.

    This doesnt quite ring true to me. I'm assuming you're talking about performance...? However I'm interested to know how you correlate user data back to a user without using the session_key as the identifier of the user...

    I have a setup where a user may store personal data on website (for example a playlist). I use an RDMBS as the storage mechanism as it is robust, relatively fast and i can port my SQL92 complient application to another RDMBS relatively painlessley. For the user to edit that bit of data (for me to retrieve the correct data) I correlate the session_id to a user_id via sql...

    OT to the original post, i'm interest in what mechanism you use, or would recommend..

Re: Re: Performance v's Maintainability
by perrin (Chancellor) on Sep 22, 2002 at 14:18 UTC
    There's nothing wrong with storing sessions in a database. If you have a cluster of servers, it's the simplest way to go.
Re: Re: Performance v's Maintainability
by diotalevi (Canon) on Sep 27, 2002 at 16:02 UTC

    I'm sure this strategy of doing session or other short-lived stuff out of the database works for smaller stuff (like mine) but there *is* a definate cost to iterate through a directory entry. Your database and operating system have all kinds of logic to cache things in memory that aren't going to be used if you do something simpler. It's something to keep in mind anyway.