Solved

Database or File or Dbm

Posted on 1997-07-10
2
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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