It would be helpful if you posted some code and example data. This sounds as if you read the entire database into memory. If so, that will certainly slow things down.

Are you using DBI.pm to read the data? A few suggestions:

  1. Look into cached database connections
  2. Consider cached, prepared select statements with placeholders.
  3. Look at what DBI::bind() can do for you.
  4. Get ruthless with globals, replace them with lexicals which only hold data you need.
  5. Benchmark. No rule of thumb can replace actual performance measurements.

A tie class may be useful, but a few sub returning data, given a key, is likely to work as well. Of course, all this is speculative and not necessarily useful.

After Compline,
Zaxo

Update: Changed list to numbered format for reference.
Thanks for the extra info on your requirements. I'm sorry to admit that I'm unfamiliar with any of the mechanisms you cite (Apache::ASP, CORBA through the COPE modules). You don't appear to use either CGI.pm or DBI.pm. (Update2: I'm informed that htoug uses DBI.)
You might try #5 'Benchmark' right away, to see where the resource hogs are.
Given your security requirements, #4 is all the more important.
As a design issue, I'd suggest starting from the user interface and seeing how few SQL statements you need to support it.


In reply to Re: Using tie to initialize large datastructures by Zaxo
in thread Using tie to initialize large datastructures by htoug

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.