You are making guesses about what will be faster. Have you done any benchmarks? In my benchmarks, simple database access with MySQL based on a primary key is faster than the shared memory options available for Perl. This is because the perl data has to be serialized before writing to shared memory and de-serialized on the other end, and because the memory chunks tend to be quite large and require reading or writing much more data than the small piece needed for a single session.

If you are really having problems with the performance of database storage (and have already followed the performance suggestions in the DBI documentation) you should look at BerkeleyDB, which uses shared memory for caching. That's the fastest option. Cache::FastMmap is also fast, but is a cache and can drop data if it gets full, so think about how you plan to use it.


In reply to Re^3: Session management by perrin
in thread Session management by deepak_biswas19

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.