Solved

Database or File or Dbm

Posted on 1997-07-10
2
143 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
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.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now