Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Difference between a declared hash and stored one with storable.

by sundialsvc4 (Abbot)
on Feb 07, 2014 at 01:25 UTC ( #1073785=note: print w/ replies, xml ) Need Help??


in reply to Difference between a declared hash and stored one with storable.

After trying various things in various projects, here’s what has consistently worked best for me:   an SQLite database file, containing data stored in YAML format, all of which data is read-only.   (Modification is not allowed, because it would be impossible to keep all of the various persistent CGI-servers in sync.)

If you know that strings are likely to be used over and over again, especially in a persistent environment like mod_perl (or FastCGI), you might decide to maintain a small Cache (there are many flavors available, ready-made ...).  But the principle is the same:   most of the data is kept on disk, and demand-loaded, with a reasonable and adjustable cap on the number of entries that are allowed to be in memory at once.

I specified YAML because I have had “unexpected problems” that I could never quite explain with Storable.   (I’d store stuff and then be unable to get it back.)   So, I use this format, which also has the big advantage of being human-readable.   Note also that I am rarely dealing with “every microsecond counts” performance-laden situations, so Your Mileage May Vary.™


Comment on Re: Difference between a declared hash and stored one with storable.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1073785]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-11-28 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (197 votes), past polls