A separate server process which the mod_perl Apache processes talk to is probably the "ultimate" answer. When some nice person names the perfect CPAN module to implement that kind of server, I'll certainly bookmark it myself (and give you a grateful thought).
Otherwise, I have used the PerlModule command in a <IfModule mod_perl.c> stanza in httpd.conf.
I didn't need to do more. The Perl module is read in at Apache start and the memory is shared with sub Apache processes.
| [reply] [d/l] |
| [reply] |
A database server really isn't the right solution to his problem. His Storable file is (as he said in a reply to your earlier post) the saved state from a module that almost certainly won't map well onto a relational database, and even if he could find some workable schema it would entail a re-write of the CPAN module he is using.
Of course, he could save it in a BLOB field in the database, but this leaves him much worse off than he was before: now he is not only loading the file into memory every time again, but he also has to transfer it out of the database which is going to have a significant amount of overhead.
Databases are a good solution to a wide variety of programming problems, but this unfortunately isn't one of them. (Unless I'm missing something -- if I am, would you mind explaining in more detail how your proposed solution would work?)
Edited to add: I might be mis-interpreting "database" as "relational database", but even using some non-relational DB like BerkeleyDB isn't going to leave him any better off than he is now, at least as far as I can see.
Edit again: Well, you could write it as a stored procedure in PL/Perl in Postgres and it would probably work, but that doesn't make it a good idea.
| [reply] |
| [reply] |