At the place of my work we deal with a number of processes
each of which is utilizing at least one database connection.
This strains our database of reasources which led me to look
at ways of reducing the number of opened database connections
at any one time by having central process that would 'serve'
a readily available database handle to an open connection to
any any script requiring one.
I've been searching PerlMonks for nodes which would cover the same
issue, but didn't find exactly what I was looking for.
For example, the author of
this node
is talking about sharing a database connection between parent process
and a number of child processes. However, I'm concerned about
having a stand alone process which would 'serve' database connections
to any number of 'external' processes upon request.
I'm now wondering just how should I approach this problem?
One option could be to have the central process share database
handler objects (such as DBI objects) with external scripts.
For this I might find the
Shared.pm
module useful. However, I'm not sure if sharing a scalar or an array is a
totally different matter than sharing a database handler object?
Another option would be to simply have the central process accept
requests from external processes in form of SQL statements and return
data via a socket connection etc.
I'd appreciate it if you could point me in the right direction.
I'm somewhat sure there must be some Perl modules that would
enable me to implement this easier than if I had to do it
on my own.
|
"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith
|