magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 02 > Script Junkie  

A DB-Based User Registration System

By Brian Wilson

Web sites often need user databases. Maybe your site has a members-only area, or maybe you send out a newsletter to keep users informed when you update your site. In any case, you have to maintain the user information on your server. However, if the user is allowed to update his or her own information, the task of keeping data current will be simplified.

There are several approaches you can use to implement a user database. You can keep all the information in a single flat file. This works adequately for small sites, but performs poorly for large ones. For a large site, you can use a full SQL database system. A SQL-based system will give you good performance, but it's expensive to implement and a challenge to use.

There's a third alternative based on the Berkeley DB package that's easy to implement but still offers the performance of a relational database system. That's what I'll show you in this article.

At O'Reilly Networks, we use the Apache Web server, running on Red Hat Linux servers. We're in the process of updating them but they are currently all flat-file based. The Apache authentication system uses a single file with all username/password pairs listed in it, one entry per line. To keep track of the additional user information (typically name and address info), we rely on a system with one file per user. This system works adequately until you accrue more than 500 users; at that point, it starts to become less attractive for several reasons.

First off, accessing a flat password file to look up a username/password pair requires a linear search through the file, so the average time to look up a record to perform an authentication will increase as the number of users grows.<>




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2