Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: CGI Application and global variables (from a database)

by swngnmonk (Pilgrim)
on Dec 19, 2003 at 18:00 UTC ( [id://315857]=note: print w/replies, xml ) Need Help??


in reply to CGI Application and global variables (from a database)

Ignoring the specific details, I have a more general concern - it seems like you want a DWIM (do what I mean) kind of solution. You want your CGI to cache values from a DB, so that you don't need to go & retrieve them every time, yet the data from the DB may change at what seems to be arbitrary times.

As we've seen in the above posts, there are a number of ways to keep this data resident in the live CGI without hitting the DB, but how do you plan to handle updates? When does the CGI know to query the DB for the new information? Is this information that should really be in a database? Perhaps this is something that should be in a config file that's read on startup?

There's nothing wrong with trying to minimize the amount of DB activity - in fact there's a lot right with that concern. That being said, DB handles can be cached and simple queries in a well-configure DB return fast. Don't create a new problem to solve one that might not be a big issue.

  • Comment on Re: CGI Application and global variables (from a database)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found