Datasheet
12
Part I: Basic Concepts
As you can see, the file contains nothing but data. Each field has a fixed
length (the Name field, for example, is always exactly 15 characters long), and
no structure separates one field from another. The person who created the
database assigned field positions and lengths. Any program using this file
must “know” how each field was assigned, because that information is not
contained in the database itself.
Such low overhead means that operating on flat files can be very fast. On
the minus side, however, application programs must include logic that
manipulates the file’s data at a very detailed level. The application must
know exactly where and how the file stores its data. Thus, for small systems,
flat files work fine. The larger a system is, however, the more cumbersome a
flat-file system becomes.
Using a database instead of a flat-file system eliminates duplication of effort.
Although database files themselves may have more overhead, the applications
can be more portable across various hardware platforms and operating
systems. A database also makes writing application programs easier because
the programmer doesn’t need to know the physical details of where and how
the data is stored.
Databases eliminate duplication of effort, because the DBMS handles the
data-manipulation details. Applications written to operate on flat files must
include those details in the application code. If multiple applications all
access the same flat-file data, these applications must all (redundantly)
include that data-manipulation code. If you’re using a DBMS, however, you
don’t need to include such code in the applications at all.
Clearly, if a flat-file-based application includes data-manipulation code that
only runs on a particular hardware platform, migrating the application to a
new platform is a headache waiting to happen. You have to change all the
hardware-specific code — and that’s just for openers. Migrating a similar
DBMS-based application to another platform is much simpler — fewer
complicated steps, fewer aspirin consumed.
Database Models
Different as databases may be in size, they are generally always structured
according to one of three database models:
✓ Hierarchical: These databases arrange their data in a simple hierarchical
structure that allows fast access. They suffer from redundancy problems
and their structural inflexibility makes database modification difficult.
✓ Network: Network databases have minimal redundancy but pay for that
advantage with structural complexity.