Database-Driven Web Sites

Taking your Web presence to the next level

By: Andrew Gianni

April 8, 2002

Editor's Note:

Synergy between advanced technologies has always been important. Fusion of Web sites and database technology is a powerful and recent example of this. Nonprofits need to update content easily and users need simple access to massive quantities of information. The trick is database driven Web sites. Andrew Gianni from One Northwest does a superb job of explaining the different ways that databases help drive Web sites.

The Adopting Technology Series is produced by Dot Org Media. Dot Org Media is a co-production of Marc Osten at Summit Collaborative and Michael Stein .

While it's no simple task, developing a basic Web site made up of pages of text and images is usually a job that can be taken on by the staff of a nonprofit organization, hopefully with a little help from a professional designer who can aid in the development of the site's look and feel. Implementing advanced features on your site, however, will most likely require a level of expertise that doesn't make sense for your organization to internalize. The goal of this article is to explain the benefits of database-driven Web pages as well as the possibilities and vocabulary involved to help you make informed decisions.

The Web Without Databases

A basic Web site is no more than a collection of text files that can be edited in a program as simple as Textpad in Windows or SimpleText in the Mac OS, along with a number of image files, which can be embedded in those pages. The pages are written in a language called HTML, which describes the way the content should be displayed in a Web browser. There are a number of tools out there (Adobe GoLive, Macromedia Dreamweaver and Microsoft FrontPage to name a few) that aid in the process of laying out these pages and allow you to use a graphical interface to format your pages rather than directly typing in the HTML code. In most cases, a series of static pages developed in this manner will suffice to deliver your message on the Web. If, however, you are ready to take the next step and deliver dynamic content on the Web, you'll most likely need a more sophisticated site.

The Basics of Database-Driven Web Pages

Using a database in conjunction with your Web pages allows you to deliver text, images, and other Web content based on specific requests for information from people viewing your site. So rather than static pages which always deliver the same information -- a list of all your staff members, for example -- you can offer dynamically generated pages which could better serve your site's visitors. An example of a dynamically generated page could be a searchable staff member database. Probably the most recognized type of database-driven Web site is the search engine. You enter some text into a box, click a button, and you are presented with a list of options that hopefully are what you are looking for. This page is generated dynamically based on the request you made and, most likely, the information is stored in a database.

The process is actually much like searching in your organization's membership database (you've got one of those, right?) for individuals in a particular state, or donors who have given more than a certain amount in the past. In this case, though, you are using a Web interface for a database, rather than the standard interface you would use if the database was running on your computer.

For example, it would be possible for you to run a database on your computer to track shipments. It could contain information on items shipped, who they were shipped to, when and how they were shipped, and what their shipping status is (backordered, in transit, delivered etc.). You might run this database on Microsoft Access on your computer, and it may serve you well, but you could also consider making the database accessible on the Web to let your customers look at information on their shipments at any time, as many large shipping companies do.

To process the words entered into a search engine or any data passed to a dynamic Web page -- perhaps a tracking number entered into a shipping Web site -- a program must be written (often called a script) to generate your results. There are a number of different programming languages commonly used for that purpose. Two of the languages that are best suited for interacting with databases on the Web are ColdFusion and PHP, although there are a number of other languages that may work equally well for different situations including Perl, Python, Javascript and VBScript. The decision as to which of these languages should be used for a particular application should be left to the individual who is developing this functionality, but if you are considering developing database-driven content for your site, you need to be aware that Web hosting companies won't necessarily offer all these options or may charge more for some of them.

There are also a number of options for databases to store the information that will make up your dynamic pages. Some Web hosting companies will allow you to use a Microsoft Access database to run your site or Microsoft's advanced database known as SQL Server. Another commonly available database for Web development is MySQL, a free database that runs on a number of different operating systems, unlike Access and SQL Server, which are limited to running with Windows-based Web servers. As when deciding on the programming language used to develop your functionality, the decision about which database to use should be made by a developer. The decision may also be informed by what's available from your Web hosting company (or you may want to consider changing Web hosts).

What's Possible?

Querying a database that sits behind a search engine is merely the tip of the iceberg when it comes to using a database to provide dynamic content for your Web site visitors. What follows are some examples of what can be done by employing a database to drive a Web site.

Directories:

Much like providing a search engine, you can provide a directory of contacts or events on the Web that can be searched in a number of ways. The data is stored in a database and can be searched through a Web interface. ONE/Northwest  maintains a directory of organizations and individuals in the Pacific Northwest conservation community.

Libraries:

If you have a large number of documents that you want to make available to the public on the Web, you might consider developing a database-driven library of these documents that would allow people to search for certain documents or browse lists of categorized documents. For example, the Trade Observatory maintains a library of documents relating to the World Trade Organization.

Surveys:

Aggregating data from surveys can be a valuable way for you to evaluate programs or collect information from your members or people who care about your work. Sending out paper surveys and doing the data entry to analyze your results can be frustrating and time-consuming, so using the Web to collect that information -- assuming a reasonable percentage of those you hope to reach have Internet access -- is a great way to simplify the process. Survey information can be entered into a Web form and stored in a database to be downloaded when the time comes to review the results. Rather than reinvent the wheel and develop this functionality yourself, you might consider using an existing survey tool on the Web such as Survey Monkey or Zoomerang.

Content management:

If your Web site contains a large number of pages or you have a number of different people involved in updating and maintaining your site, you may consider using a content management system to maintain a consistent look and feel for all your pages, manage all the content, and provide an easy interface to update your pages. Rather than developing a number of static Web pages, you develop the content and plug it into a template for your Web site. The information is stored in a database. At ONE/Northwest , we use a content management system for our Web site. As you browse the site, you'll notice that all of the URLs actually end with the same file name (page.cfm) followed by some additional text. This text tells the database which page should be displayed.

Portals:

In the past four years we've been inundated with Web sites beginning with the word "my": MyYahoo, MyExcite, MyTechSoup. These sites are commonly known as Web portals, and their purpose is to give visitors the ability to customize the content they see and how it is displayed. If you produce a lot of new content regularly, a portal model may be a great way to serve the needs of a number of diverse audiences.

Internal databases:

All of the above examples concern public Web sites, but you could also consider using the Web to store an internal database that you can share with staff members or collaborators across a diverse geography. There are a number of services available, and a good place to start looking at your options is Yahoo's list of online database services.

What Does This All Mean to You?

There are clearly many ways through which you can augment your Web site by using a database. Probably the best way to start thinking about which options may work best for your organization is to work with a consultant to discuss the possibilities. Don't try to make technical decisions about how to implement certain features. Rather, start by deciding what you want your Web site to do and have a consultant help you decide on the technology to make it work.

You'll notice that most of the examples deal with different ways of sharing information, so start by looking at the information you have to share, or could develop. Then think about the people you want to share it with and how they'd like to access that information. As with technology in general, always start by thinking about what it is you want to accomplish and let the Web be a means to an end, not an end in and of itself.