Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Regarding flat file access vs. database

Expand Messages
  • Mr. Shawn H. Corey
    ... I think they don t teach enough analysis in school. How are you using this data? Do you, most of the time, look up single records? Or do you use it all to
    Message 1 of 4 , Apr 5, 2006
    • 0 Attachment
      On Wed, 2006-05-04 at 16:03 +0200, Roman Daszczyszak wrote:
      > Hello all,
      >
      > I am trying to figure out a way to do something in Perl, and would
      > appreciate y'alls opinion.
      >
      > I have a Perl script that I run each night to gather computer
      > information from the workstations on my network. It collects the
      > Windows NetBIOS name, the IP address and the MAC address, then dumps
      > this info into a tab-delimited file, one record on each line.
      >
      > I would like to improve upon this functionality by having the script
      > pull the previous night's information in, run the collection, then
      > compare the two sets of results and update any changes to the DB.
      > Reason being, right now if a machine is offline for the night, it gets
      > "wiped out" from the inventory when the script is run. Whereas it
      > should remain, unless the MAC address or computer name actually moves
      > to a different IP.
      >
      > Now, given the relatively small amount of information gathered right
      > now, I think a flat file is fine. However, if someone can point me at
      > a simple database that is easily implemented in Perl, that would be
      > great too.
      >
      > What do you all think? Flat file or database?

      I think they don't teach enough analysis in school. How are you using
      this data? Do you, most of the time, look up single records? Or do you
      use it all to create a report or a statistical summary? Databases work
      best when most of the work is looking up a single (or a small set) of
      records. If you use all the data, a flat file takes up less disk space
      and is faster.

      I would have one array in my program that contained all the records and
      use tie (see `perldoc -f tie`) to give it persistency. That way, if a
      machine cannot be contacted, its old record remains.


      --
      __END__

      Just my 0.00000002 million dollars worth,
      --- Shawn

      "For the things we have to learn before we can do them, we learn by doing them."
      Aristotle

      * Perl tutorials at http://perlmonks.org/?node=Tutorials
      * A searchable perldoc is at http://perldoc.perl.org/
    Your message has been successfully submitted and would be delivered to recipients shortly.