I apologize for the broadness of this question. I'm hoping for some opinions from the monks on the most efficient data storage method for some scripts I'm writing. Descriptions are as follows:

1. The data is a listing of network switchports and their characteristics. It's currently stored in a text file that uses 1 line for each port. The script that currently runs over it stores each line in a multilevel hash, and I'd like to keep that format (something like $ports{switch}{interface}{x|y|z}). I was thinking of using MLDBM, of course, but what underlying DB? There will be a frequent cron job that reads in the data, updates it, and writes it out, as well as some CGI apps that are run by users, mostly to read, but occasionally to write changes. I was thinking maybe GDBM, since it apparently offers file locking, but I can also just use a semaphore file with flock. Would any type of DB have an advantage over others?

2. This one is a bit more tricky. It's going to store a large number of entries in multiple databases. Most of the data is composed of large text fields (1 field in particular is usually a sizeable paragraph). A number of scripts will read from this and may have to parse over different parts of the data. I was wondering if an SQL DB with multiple tables would be best for this, or if some of the DB modules would handle this okay (as a small side note, I don't know SQL, but learning it is not an issue if it would be the best option).

Thanks in advance for your advice!


In reply to Which databases to use? by wink

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.