Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Persistent Data: my choice, and (hopefully) monks' thoughts.

by corenth (Monk)
on Apr 06, 2013 at 06:46 UTC ( #1027256=perlquestion: print w/ replies, xml ) Need Help??
corenth has asked for the wisdom of the Perl Monks concerning the following question:

Good day to all. This is a question about data persistence.

Context

A complex data structure, many hashes deep and many hashes wide, needs to be read from and written to. It needs to persist between program runs. I don't need to have more than a bit of it in memory at any time.

I found use MLDBM through http://www.perl.com/pub/2006/02/16/mldbm.html.

Pros: does all the above.

Cons: Need to extract a reference to work on and save it back to the file. EDIT: Con: can't edit references directly in the database file because references are no longer tied once extracted. This makes for clunkier code.

Questions

Is this good, bad, and/or ugly? Is this the state of the art? What are the different ways that monks have dealt with this kind of situation? Will I ever come to a decision? Am I forever doomed to to obsess about it? Tune in next week . . .

Thank you all. EDIT: spell check fail (persistance changed to persistence) (thank you erix)
$state{tired}?sleep(40):eat("crow");

Comment on Persistent Data: my choice, and (hopefully) monks' thoughts.
Download Code
Re: Persistent Data: my choice, and (hopefully) monks' thoughts.
by Anonymous Monk on Apr 06, 2013 at 07:44 UTC
      But why "Anonymous"? This is such a damned useful reply. I'm investigating DBM:: deep at the moment. Thank you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2015-07-02 08:45 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 (31 votes), past polls