Dynamic Sites Take Over
January 10, 2000
An informal survey of Web developers (well, very informal -
I called a couple of buddies on the phone) reveals that for
medium-to-large corporate clients, dynamic sites, as opposed
to flat sites, are now the rule. A "flat" site is one built
out of static HTML pages. You code each page individually
in HTML, put the pages upon the Web server, and there
they are. On a "dynamic" site, on the other hand, an
individual page doesn't exist as a finished HTML document
until it is requested. When a user requests a page, the
system builds it from three sets of data:
- HTML templates, which define the overall layout of the page,
and contain any elements that are common to all pages.
- The content of the page, which is retrieved from a database.
- Any user input which may be required to create the page.
Dynamic Web pages are nothing new, and many a flat site
contains one or more dynamic sections. Such things as
search engine results and discussion group posts are by
definition dynamic, since they require user input. Also,
there may be situations in which you want to rotate a
certain part of a page's content, which can be done very
easily (although inefficiently from a server-load standpoint)
using server-side includes. I discussed this and other
quick-n-dirty dynamic tricks in an
URLier WDVL article.
Dynamic sections within a site may be handled with scripting,
as is often the case with a search engine - there are lots of
search engine scripts
out there, ranging from cheap shareware
to brand-name commercial solutions. More complex dynamic
applications, such as an interactive discussion forum, are
typically done by means of a software package that runs on
the server. Here at Internet.com, we use a package called
Web Crossings to power our
discussion forums.
What about making a whole Web site dynamic? Very large Web
sites have used the dynamic approach for a long time, but
nowadays, even for medium-size sites, dynamic delivery is
becoming the norm. There are many ways to build a dynamic
site, ranging from homegrown systems using
Perl,
PHP,
Java,
VB, COBOL (well, maybe) or the language of your choice, to
more structured commercial packages such as ColdFusion and
ASP.
The advantages of a dynamic site are:
- It's easier to update and change content. If you need
to change a page header, all you have to do is change one
file, instead of doing a search-and-replace on all the pages
affected, then uploading all those pages to the Web server.
- Since content is stored in a
database as plain text
(or graphics, audio or whatever), the people who create
and maintain the content don't need to know anything about
HTML, or about how the pages are organized and laid out.
The tedious task of coding content into HTML templates is
eliminated.
- Adding user interactivity is much easier. Today's Web
users expect a high degree of interactivity. A dynamic
system allows you to offer interactive features smoothly
and efficiently, and to incorporate personalization features
that wouldn't be possible with a flat site.
- Patchy and inefficient dynamic doodads can be eliminated.
For example, if one had a fully dynamic site, the
bandwidth-hogging
SSIs
mentioned above wouldn't be
necessary. The dynamic system could do the same thing more
efficiently.
- Compatibility problems can be dealt with more efficiently.
For example, say you have a script that determines a user's
browser version, and chooses a version of a page accordingly.
Users with the latest browsers are shown a way-cool page with
lots of Java and streaming media, while past-dwelling
Luddites are shown a page of plain HTML. With a flat site,
this would require creating (and storing on your Web server)
two complete versions of every page. With a dynamic site,
you'd only need to have different page templates. The content,
stored in a database as plain text, would be the same for
either version.
The full significance of this last item becomes apparent
when you start thinking about accessing the Web from non-PC
devices (I mean devices other than computers, not devices
that aren't politically correct), which will soon be very
common. If we had a flat site, which we wanted to be
viewable on a Dick Tracy watch with a tiny video screen,
we'd just about have to create a whole duplicate site,
formatted appropriately. Ah, but had we that blessed
entity, the Dynamic Site, then we'd only have to create
a template that would format our content for that silly
Dick Tracy watch. And when someone came out with a Star
Trek communicator, which of course would require totally
different formatting than the Dick Tracy watch, then would
we truly begin to see how wise we were to choose the dynamic
way.
Now that we've heard the cheerleading squad, how about the
nay-sayers? Are there any disadvantages to dynamic sites?
Oh, yes.
- Dynamic sites can be more crash-prone than flat sites.
With a flat site, the only piece of software gadgetry on
your end is the Web server itself, and all the popular Web
servers are fairly bulletproof. With a dynamic site, you're
adding a lot of complex scripting to the equation (plus
the database). I'm sure to get a flood of protests about
this statement, but speaking solely from my experience as
a frequent Web surfer, I can tell you that dynamic sites
tend to malfunction. A lot. A custom-scripted dynamic site
can be quite reliable, if it is carefully designed and
maintained, but that's a rarity in today's rush-and-release
business world. The major off-the-shelf dynamic solutions
have poor reputations when it comes to reliability.
Active Server Pages (ASP)
is made by Microsoft, which (to put it
as delicately as I can) is not exactly world-famous for
bulletproof products. The other big name,
ColdFusion, has
earned some harsh criticisms for its reliability. Of course,
both products are being improved all the time, and their
dependability, or lack thereof, is no different than any
other type of complex software. A slightly higher error
rate is the price you pay for the advantages of a dynamic
site.
- A second drawback of dynamic sites is that they cost
more to build and maintain. A flat site can be built without
spending a penny on software, as a
recent series of WDVL articles explains in detail.
Neither ASP nor ColdFusion is free, although PHP and other
do-it-yourself scripting solutions are. Naturally, dynamic
sites require expertise to build and maintain. Folks who
can write decent HTML are common, but people who know how
to "do it dynamically" are rarer, and much more expensive.
- There's also the "open versus proprietary" question.
HTML is an open, commonly-known standard that belongs to
no one. Going the dynamic route locks you into doing things
in a certain proprietary way, whether you use one of the
commercial solutions or devise your own scripting system.
The drawbacks of dynamic systems are simply part of the deal,
and shouldn't discourage Web developers from getting with
the program. Cutting-edge technologies are always unreliable
and expensive, but improvements are being made all the time.
For an overview of the huge variety of Web authoring
possibilities, check out the WDVL's
Authoring section.
A Look at the Web Development World Ahead
A Look at the Web Development World Ahead
Interactivity is the name of the game
|