Solved

Database or File or Dbm

Posted on 1997-07-10
2
145 Views
Last Modified: 2013-12-25
I am a newbie to CGI progrmming etc. As part of a project I have to create an application to monitor certain server. The settings for the things to be monitored on each server is to be obtained using forms. Now there are at most going to be 10 servers being monitored at a time. I have the following questions:

1. Do I store the data for each server in a file or use a database?

eg for given machine named X there is a file X_config, or a table in a DB with the things to be monitored, obtained from the form, written into the file, DB. Everytime the config is changed( by a number of users) the file, DB has to be updated. The data for each machine is the written to a temp file, from which a crontab is created?

Which is better a file or a DB?

2. Because there is the possibility of a certain number of users being able to add servers to be monitored or modify certain settings for servers, if I were to use a DB do I need to makesure there is  a lock in place everytime someone modifies a server?
0
Comment
Question by:fitzroy8
2 Comments
 
LVL 5

Accepted Solution

by:
icd earned 60 total points
ID: 1829020
The choice of file or DB is a complex one. If you are not going to complex relational queries and a relatively flat file structure will do (which I suspect is the case in your application) then you might choose to use a file based database written in perl.

Another factor is how familiar you are either with a DB or perl.

If you only have a couple of handfulls of servers then, as you say, you could have a single file for each server. You would parse the file with a simple perl program. The file might be something like:-

ServerName,Proteus
Organisation,Accounts
etc,etc

You could easily read this in with a perl program. Modifications would involve reading the file in, modifying the variables and writing it out again. If there is the possibility of conflict between users then the perl 'flock' command should be used.

If you use a DB solution then there are often either automatic locking methods or ones you can call.

0
 

Author Comment

by:fitzroy8
ID: 1829021
Thanks,

I think that I'll just start off with a simple file;


0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question