Killersites Newsletter Archive

Using Database Driven Web Pages

Killersites Newsletter Archive November 9th, 2003

If you don't know what database driven web pages are, then read this article:

Article on what database driven web pages are.

To begin with:

When should you use a database driven web page or site:

  1. Data changes often. Examples: store product catalogued
  2. You need to perform calculations or apply some sort of algorithm to the data that affects the way it is presented on your page. Example: shopping cart

Why not use database driven pages for all your websites text?

•  Formatting and styling of the page layout is much more difficult on text elements derived from a database.

•  Database connections are expensive in terms of time and processing power; it is always faster to deliver static pages.

•  Many search engines may not be able to 'see' your pages.

Storing articles in a database can be a bad idea. Paragraph formatting, inserting inline images, emphasize on certain elements is just more difficult. Like with many technologies, when people come across them, they can go a little crazy and start trying to apply them in just about every given situation.

I found myself there a few years back when I started dumping my sites into a database and was calling articles/content out of tables. I then discovered how hard it was to manage the look of the web pages though everything was neatly catalogued in the database.

Some people will argue that storing the website in a database allows you advantages like:

1. Being able to catalogue and perform searches against the site.

If you want to make your web site searchable you can do so with site-crawling software that will catalogued and index your pages just like a search engine does. There are both server side (Java, .Net etc.) and client side (JavaScript) solutions that do this nicely.

On a side note, if you guys and gals are interested in a client side search tool that you can insert into your websites, let me know. I am trying to decide what my next 'fun' project will be and when finished would like to have something that people will find useful, for free of course!

2. Be able to easily move your content to different parts of the site just by calling the articles from the database wherever you want it to appear.

This may seem like a good idea at first, but when you consider the time it takes just to set up the database and the connections and the code to talk to the database your better off using either:

A: Server side includes (SSI).

B: Client side includes like Dreamweaver's Library items.

Both these templating mechanisms allow you to place your reoccurring web content, whether it be articles and combination of articles and images into separate files and insert these files into any pages you want them to appear. If you change your source template and changes automatically appear in all your other pages.

Side note: if you want a tutorial on how to do this in Dreamweaver and or say Perl or ASP, PHP etc., let me know.

A quick note about CSS validations and standards compliance.

Before I go on, let me just say I like CSS and CSS-P.

There are a couple of camps regarding the use of CSS, some are big time pro-CSS zealots while other are simply offended by those zealots. I am not going to rehash all the arguments because too many details can be really boring unless you're a really big nerd. (I actually like the details . but I'm a really big nerd!) I have just a couple of points:

Standards are only as good as the support for them.

The danger of academics is ignorance of reality. It is fine to code to standards, and I think it is a good idea. But the reality in web design is found not in the standards but in the browsers used . We are not designing for a potential tomorrow, rather we are designing for what is real today.

One of my concerns in the zealots' discussion of CSS (and how we should adhere to standards) is that they seem to put the various browsers (Internet Explorer, Mozilla, Opera etc) on same level. In terms of importance, they give all the browsers equal lip service! This makes no sense at all since today, the reality is that somewhere around 96% or more of the browsers being used are Internet Explorer browsers. The other browsers are very rarely used indeed!

If you liked the article and you want to see more let me know!

Stefan Mischook.

© 1996 - Killersites.com – All rights reserved