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

Re: Perl with Database connection.

by scorpio17 (Canon)
on Aug 03, 2009 at 13:35 UTC ( [id://785463]=note: print w/replies, xml ) Need Help??


in reply to Perl with Database connection.

The answer is "it depends".

In most situations, database connections are a limited resource, just like disk space or bandwidth, etc. For example, if you had a maximum limit of 100 database connections, and many clients trying to connect at the same time, you would want each client to get its data then disconnect as soon as possible, in order to not block other clients. This would be like an ATM machine checking an account balance at a bank.

On the other hand, if you had a server connected to the database, and lots of clients making similar requests at the same time, it might be better for the server to establish a single, persistent connection to the database, and cache commonly accessed data to avoid redundant queries. This would be like a web site where users read book reviews, for example.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2026-01-23 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (125 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.