Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!aunro!alberta!herald.usask.ca!ccu.umanitoba.ca!news From: rahard@eeserv.ee.umanitoba.ca (Budi Rahardjo) Newsgroups: comp.lang.perl Subject: need advice - writing a database system Keywords: database, dbm Message-ID: <1991May3.093532.19393@ccu.umanitoba.ca> Date: 3 May 91 09:35:32 GMT Sender: news@ccu.umanitoba.ca Followup-To: comp.lang.perl Organization: Dept. Electrical Engineering, U of Manitoba Lines: 48 Hi there, I am in the process of writing a userid database for our computer networks. We have approx. 17000 users (4 networks and only considering valid userids for the last 5 years). There are apporx. 30 fields for each record (userid, name, uid, gid, e-mail, reg.date, expiry date .... etc.) The objective here is to have unique userids and UIDs. For example userid will be created if nobody is using it, and the database will give a new UID. (This brings a policy/question of recycling uid, *sigh*) Also this database should be accessible only by system administrators of the 4 networks thru a client program. I am going to write a database server and client in perl on a networked-Sun. (actually I have a prototype up and running, but I am not satisfied) I need suggestions : 1. Would you use a flat file or dbm file for the database ? 2. Would you slurp the whole file ? (considering the number of fields, and the size of the database) 3. If I use dbm file (with assoc. array) - I'd like to index it with different fields (ie, userid, lastname, uid). How do I do this ? (Use different dbm files ?) - When I update a record, I want to save it right away. Do I have to close the dbm file (dbmclose) and re-open it again ? ie. Is there away I can update the dbm file without closing it ? 4. Access to the database by more than one persons at the same time is desireable. How would you lock the database when you perform critical operations, like add a new entry, or updating a record ? (Use perl lock ? or just create a file, say "lock.db", then remove it after you're done ?) 5. Security How would you implement security ? (Right now I have it setup like pop-mail; after you connect, send an id then send a password). 6. Comments ? Thanks, -- budi Note : - I have tried "jinx", it's too slow, doesn't have a locking facility and I don't want the user to be able to change the database structure. I wonder if there is an enchanced-jinx .... -- Budi Rahardjo Electrical Engineering - University of Manitoba - Canada