Datasheet

What Is a Database?
It’s fair to say that most computing applications make use of data in one form or another, whether in an
obvious way or with more subtlety. In most cases this data is persistent, which means that it is stored
externally to the application and doesn’t disappear when the application isn’t running. For example, the
following applications obviously store and manipulate data, in small or large quantities:
An application used by a shop to keep records of products, sales, and stock
An application used to access human resources information in a large enterprise
A web page that allows the retrieval of historical currency conversion rates
It is a little less obvious whether the following applications use stored data, but it is likely that they do:
Any web page you care to examine — many store some if not all the information they display in
external locations.
Web pages that don’t display stored data, but that track user activity.
Online games with persistent worlds where player and character information is stored in a cen-
tralized online location.
Of course, it’s also difficult to say exactly how these applications store their data. It is possible that the
software developers store data in text files on a hard disk somewhere, in computer RAM, or even on
stone tablets that are manually transcribed to a computer terminal when requested by a user. It is far
more likely, however, that they store data in a database.
The Oxford English Dictionary defines the word “database” as follows:
1. A structured collection of data held in computer storage; esp. one that incorporates software to make
it accessible in a variety of ways; transf., any large collection of information.
This definition alone goes some way to describing why a database is better than, for example, storing
text files. A key word here is structured. Simply storing large amounts of data in an unstructured way,
such as text files, is usually referred to as flat-file storage. This has many disadvantages, including the
problem of compatibility when proprietary storage formats are used, the inability to locate specific infor-
mation stored somewhere in the middle of the data, and the general lack of speed in reading, editing,
and retrieving information.
Databases provide a standardized way to store information, and do so in a manner that promotes
extremely fast access by hundreds, even thousands, of users, often simultaneously.
A phone book, for example, contains the names of individuals (or organizations), phone numbers, and
possibly addresses. Flat-file storage might involve no ordering whatsoever — perhaps a bucket containing
each name/phone number/address combination on a separate piece of paper (which would make retrieval
of any specific one an interesting challenge at best). More likely, there would be some organization, typi-
cally by the first letter of people’s last names, which is a step up from a bucket of data, but still lacking
finesse. This data might make up the basis of a flat-file storage format (each record in order, encoded in
some machine-readable or human-readable way), but can more accurately be called a directory. Directories
are data stores that are organized in a way to optimize data retrieval in one specific mode of use. In this
example it is easy to find the phone number of someone as long as you have his name, but the inverse
2
Chapter 1
44063c01.qxd:WroxBeg 9/12/06 10:30 PM Page 2