Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I use BerkelyDB for a LOT of stuff, especially configuration info. It's fast and easy and certainly less of a pain in the ass to set up, but just keep in mind that there are some drawbacks as well. For a time I found myself creating pseudo-logic structions by accessing data by $db{"$key.$val"}. Using such a structure is cute but becomes hard to manage rather quick. The other issue is fixing incorrect data. Because there is no direct access to the database file itself, you might need to keep this in mind. I made a program myself that allows me to fix/add/delete stuff from the database, but as far as I know there isn't any defacto program that anyone has made.

The other big drawback is that BerkelyDB databases aren't very portable. I'd generally assume that once you make a db file on one server, that it's only going to work on that server. Making a raw export into text might be something to consider for a backup plan.

Now for what you want to do, storing simple things that you want to access via a key (like configuration info and simple mail dump) BerkelyDB works REALLY well. Where it sucks is when you need to get meaningful information out of stuff that is locked up in your database - which means you end up doing stuff like rather messy loops and such. So for what you do now it would be great, for what you want to do in the future, maybe not. I guess that depends on how many db files you plan on breaking this up into, and how you structure your keys.

As an aside an alternative thing to think about is using XML , although slower, it's a lot more fault tollerant.

In reply to Re: Wisdom sought on migrating from text files to Berkeley DB or SQL by archen
in thread Wisdom sought on migrating from text files to Berkeley DB or SQL by punkish

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (8)
    As of 2014-12-27 01:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (176 votes), past polls