hardburn has asked for the wisdom of the Perl Monks concerning the following question:

I'm building a web application under mod_perl that needs to store short-term state information. Much of the information tends to change slowly, and is handled by a PostgreSQL database. However, there is one portion of the application that will be changing information (potentially) several times a minute.

I do not necessarily need an SQL database to do this (though the final results of this process might go back into PostgreSQL), but I do need it to have good performance. I need some sort of connection persistance across requests (like Apache::DBI). A completely in-memory database would be perfect.

Are there any existing modules that allow you to, say, grab a saved, in-memory hash from across Apache processes?

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re: Database for Transient Information
by perrin (Chancellor) on Mar 02, 2005 at 15:52 UTC
    BerkeleyDB and Cache::FastMmap both do this extremely fast.

      I think Cache::FastMmap is exactly what I need. Thanks.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re: Database for Transient Information
by dragonchild (Archbishop) on Mar 02, 2005 at 15:47 UTC
    I think you're looking for Cache ... or does this not satisfy your needs?

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Re: Database for Transient Information
by manav (Scribe) on Mar 02, 2005 at 16:00 UTC
Re: Database for Transient Information
by jZed (Prior) on Mar 02, 2005 at 17:00 UTC
    You can suck the Pg table into a DBD::AnyData in-memory table and cache it. You can then use SQL to query or modify the cache without going back to Pg. Pair Networks (our kind host) uses this method for some of their sites. Dan Wright from Pair will be giving a talk on this at YAPC N.A. If you want to try it and have questions, let me know.