Datasheet
Chapter 1
10
Pros and Cons of Data-Driven Web Sites
Some of the advantages of having a data-driven system are immediately apparent, but there are others
that are less tangible and not so readily evident. Naturally enough, there are also reasons why you might
not want to attach a web site to a database. In this section, we'll examine the benefits and the drawbacks
of creating a web site that's based around a data source.
Advantages
There are many secondary benefits of making a web site data-driven, such as the ability to reuse
portions of functionality in other projects, and being able to share common pieces of information across
systems – these tend to kick in when you start to work on your second or your third web application.
Here, we're going to look at some of the advantages that can start to accrue as soon as you make the
decision to create a data-driven site:
❑ Quality and timeliness of content. The most immediate advantages to making a site data-driven
are the speed with which new information can be presented on the Web, and the controls that
can be put in place to guarantee the quality of this information. Rather than having to get a
web designer to create a page containing the information, and then get it uploaded again
every time a price changes or a new product is added, a tool can be created that enables the
instant publishing of new or updated information simply by modifying the database. This is
one of the key benefits of the Web over traditional media – the ability to view information in
real time, rather seeing than a snapshot of old data. By enforcing rules on who can add and
amend data, how it is checked, and whether it is approved, data can be verified prior to being
published in a much more rigorous manner, ensuring that the user only sees accurate details.
❑ Functionality. The other main benefit of storing all of the data required for a site in a database
is that of improved functionality in terms of the actions that the user can perform on the
system. Rather than producing 'catalogues', which (like this book) just have an index and a
contents table as a means of searching, forms can be created that allow the user to specify
what is being looked for, and have the system scour the database for that information. A great
example of this is a search engine. Without a database, such a site would present only a
manual categorization of other web sites, with a huge structure of pages that you could (try to)
navigate between.
❑ Maintenance. With the data for a site stored in a separate location from the presentation code,
there is no longer a need to maintain static links in HTML files between related sections of a
site, forcing you to reapply formatting and menu structures to hundreds of pages each time the
site is redesigned. In a data-driven system, web pages are typically templates that act for entire
classes of pages, rather than having one page for each piece of information.
As an example of this, you could imagine the on-screen appearance of a page that displays the
details of a product for sale. Rather than this being a separate HTML page, in a data-driven
system there would be one page containing fields and tables that could be populated with data
regarding any product. This means that there is far less to do each time a redesign is
implemented. Similarly, as the relationship between different pieces of information can be
stored in the database (rather than hard-coded in the pages), links to related products and
other information can be generated on the fly.