I am planning to use mod_perl with a hobby program I'm writing.

Common data can easily be shared between httpd processes by using "PerlModule" in the Apache config (right?). Even if all processes needed to load data, it's just at process start anyway.

There is still the "usual" problem -- complex user state. I've seen "Sharing data structures in mod_perl" (and similar ones). (Update: To make it clearer, the problem is that the user state is potentially so complex that recreating it will be prohibitive for all web accesses.)

Q1: There is no "normal" way to make a mod_perl program to keep state for a given user, since requests will go to random processes, right?

I wrote my program with an interface "split" in the middle. I could use SOAP or some other interface, with the not-so-stateful UI running on the web server. (Or even let the users have a Tk client for the UI.)

Q2: What modules on CPAN are recommended for stateful servers for (some kind of) RPC calls? (From local machine's mod_perl or over the internet.)

Background (can safely be ignored):

I started out writing a data editor for an old favorite game. This ended up as potentially useful for other people's needs. (In hindsight, you could probably have mapped this quite well onto XML and let a Schema spec do a good part of the work. :-( )

I have no idea if five people or five thousands will have a use for this.

(-: I have a neat plan for the license. If I copyleft the program, all data used has to be released (since code is generated from data and linked in). This is my evil plan to lighten the documentation needs... "don't complain, look at all the example data!" For those not willing to follow the GPL, I'll grudgingly send a non-GPL version for a non-modest fee. :-)


In reply to Shared between mod_perl processes? by BerntB

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.