If you are looking for simple hack-friendly solutions, you can serialize (i.e. store) arbitrary data structures to disk and read them again the next time with something like YAML::LibYAML.

As long as your program needs to access the whole database anytime it wants to draw the earth you might as well slurp the entire hash in one go from file to memory (or use one file per day if you want a nice way to segment the data or invalidate or overwrite old data) instead of using a database.

The best thing, the data on disk is human-readable, so there is always the possibility to use emacs grep and less to edit, view or search your data.

Performance should be a bit slower than Tie, but you don't have to think about how to store more complicated data structures like hashes of arrays. YAML does that for you.

Also this solution is a bit low on scalability, but as long as your data doesn't go into tens of megabytes you are on the safe side. And you can always upgrade to a database, if you need to scale up or need a more 'random access' on the data.


In reply to Re: More than one way to skin an architecture by jethro
in thread More than one way to skin an architecture by mcoblentz

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.