Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 chanting in the Monastery: (5)
As of 2015-07-06 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls