You are on page 1of 7

Wachemo University__Department of Computer Science

Chapter 2
DATABASE SYSTEM ARCHITECTURE
2.1. Data Models, Schemas and Instances
Data model
It is a set of concepts to describe the structure of a database, and certain constraints that the
database should obey. It is a description of the way that data is stored in a database. Data model
helps to understand the relationship between entities and to create the most effective structure to
hold data.
Data model is an integrated collection of concepts for describing data, relationships between
data, and constraints on the data in an organization.

Data Model is a collection of tools or concepts for describing


� Data
� Data relationships
� Data constraints
Data model comprises three parts:
1. A structural part: set of rules to construct the data base
2. A manipulation part: type of operations to be performed
3. Integrity rules: which insures that the data is accurate
The main purpose of Data Model is to represent the data in an understandable way.
Categories of data models include:
1. Object-based data model
 Uses concepts such as entities, attributes and relationships
 An entity is a distinct object (student, client, policy)
 Attribute: a property that describes some aspect of the entity
 Relationship: association between entities
 Common examples of object-based data models are:
 Entity-relationship(ER) data model
 Object-oriented data model
2. Record-based data model
 The database consist of a number of fixed format records
 Each record type defines a fixed number of fields
 Each field is typically of a fixed length
 Common examples are:
 Relational data model
 Network data model
 Hierarchical data model
Schemas and Instances
When a database is designed using a Relational data model, all the data is represented in a form
of a table. In such definitions and representation, there are two basic components of the database.
The two components are the definition of the Relation or the Table and the actual data stored in
each table. The data definition is what we call the Schema or the skeleton of the database and the

1 Fundamentals of Database System


Wachemo University__Department of Computer Science

Relations with some information at some point in time is the Instance or the flesh of the
database.
Schemas
� Schema describes how data is to be structured, defined at setup/Design time (also called
"metadata")
� Since it is used during the database development phase, there is rare tendency of changing the
schema unless there is a need for system maintenance which demands change to the
definition of a relation.
� Database Schema: specifies name of relation and the collection of the attributes (specifically
the Name of attributes).
 refer to a description of database/intension of the database
 specified during database design
 should not be changed unless during maintenance
There are three different kinds of schema in the database defined according to the 3 level ANSI-
SPARC architecture:
Internal/physical schema: at the internal level to describe physical storage structures and access
paths. Typically uses a physical data model.
Conceptual/logical schema: at the conceptual level to describe the structure and constraints for the
whole database for a community of users. It uses a conceptual or an implementation data model.
External schema: at the external level to describe the various user views. Usually uses the same
data model as the conceptual level.

Instances
� Instance: is the collection of data in the database at a particular point of time (snap-shot).
 Also called State or Snap Shot or Extension of the database
 Refers to the actual data in the database at a specific point in time
 State of database is changed any time we add, delete or update an item.
� Since Instance is actual data of database at some point in time, it changes rapidly.

2.2. Database Architecture


A major aim of a database system is to provide users with an abstract view of data, hiding certain
details of how data is stored and manipulated. Since a database is a shared resource, each user
may require a different view of the data held in the database. To this effect, a standard
terminology and general architecture of database system should be used.
The American National Standards Institute/Standards Planning and Requirements Committee
(ANSI-SPARC) introduced the three-level architecture of the database based on their degree of
abstraction.
The purpose and objective of the Three-Level database architecture
� All users should be able to access same data. This is important since the database is having
a shared data feature where all the data is stored in one location and all users will have
their own customized way of interacting with the data.
� A user's view is unaffected or immune to changes made in other views. Since the
requirement of one user is independent of the other, a change made in one user’s view
should not affect other users.

2 Fundamentals of Database System


Wachemo University__Department of Computer Science

� Users should not need to know physical database storage details. As there are naïve users
of the system, hardware level or physical details should be a black-box for such users.
� DBA should be able to change database storage structures without affecting the users'
views. A change in file organization, access method should not affect the structure of the
data which in turn will have no effect on the users.
� Internal structure of database should be unaffected by changes to physical aspects of
storage
� DBA should be able to change conceptual structure of database without affecting all users.
In any database system, the DBA will have the privilege to change the structure of the
database, like adding tables, adding and deleting an attribute, changing the specification
of the objects in the database.
Three-level ANSI-SPARC Architecture of a Database

External Level:
 Users' view of the database.
 It describes part of database that is relevant to a particular user.
 Different users have their own customized view of the database independent of other
users.
Conceptual Level:
 Community view of the database.
 Describes what data is stored in database and relationships among the data.
 It is the logical structure of the entire database as seen by the database administrator.
 Represents
 All entities, attributes and their relationships
 The constraints on the data
 Semantic information about the data
 Security and integrity information

Internal Level:
 Physical representation of the database on the computer.
 Describes how the data is stored in the database.

3 Fundamentals of Database System


Wachemo University__Department of Computer Science

 It is about the data structure and file organization used to store the data on storage
devices.
 It is concerned with such things as:
 Storage space allocation
 Record description for storage
 Record placement
 Data compression, data encryption …

Data Independence

The major objective of ANSI-SPARC architecture is to provide data independence, i.e. upper
levels are unaffected by changes to lower levels.
Data independence is the ability to modify a schema definition in one level without affecting
schema definition in the next higher level. It is the strength of higher levels to changes to lower
levels.

There are two types of data independence

1. Logical Data Independence:


 Refers to immunity of external schemas to changes in conceptual schema
 Conceptual schema changes e.g. addition/removal of entities should not require changes
to external schema or rewrites of application programs.
 The capacity to change the conceptual schema without having to change the external
schemas and their application programs

2. Physical Data Independence


 Refers to immunity of conceptual schema to changes in the internal schema
 The ability to modify the physical schema without changing the logical schema
 Internal schema changes e.g. using different file organizations, storage structures/devices
should not require change to conceptual or external schemas
 The capacity to change the internal schema without having to change the conceptual
schema
� In general, the interfaces between the various levels and components should be well defined
so that changes in some parts do not seriously influence others.

4 Fundamentals of Database System


Wachemo University__Department of Computer Science

2.3. Database System Architecture

A) Centralized Database System Architecture


Centralized database systems are those that run on a single computer system and that do not
interact with the other computer system except for displaying information on display terminals.
Earlier architectures used mainframe computers to provide the main processing for all functions
of the system, including user application programs and user interface programs, as well as all the
DBMS functionality. The reason was that most users accessed such systems via computer
terminals that did not have processing power and only provided display capabilities. So, all
processing was performed remotely on the computer system, and only display information and
controls were sent from the computer to the display terminals, which were connected to the
central computer via various types of communications networks.

Terminals Display monitor Display monitor Display monitor

Network

Application Terminal Display control Text Editor


program

DBMS Compiler
Software

System bus

Controller Controller Controller

CPU
I/O device (printer
Hardware Memory Disk tape derivers…)

Operating System

Fig 1.4 : A physical centralized architecture.

5 Fundamentals of Database System


Wachemo University__Department of Computer Science

B) Client/Server Database System Architecture


In the Client/Server architecture the client processes run separately from the server processes,
usually on a different computer. The architecture enables to specialized servers and workstations
(clients). The general structure of client/server architecture is shown below.

Client Client Client Client

File Server Mail Sever DBMS Server

Fig 1.5. Structure of client/server architecture

The concept of client/server architecture assumes an underlying framework that consists of many
PCs and workstations as well as a smaller number of mainframe machines, connected via local
area networks and other types of computer networks. A client in this framework is typically a
user machine that provides user interface capabilities and local processing. When a client
requires access to additional functionality-such as database access-that does not exist at that
machine, it connects to a server that provides the needed functionality. A server is a machine that
can provide services to the client machines, such as file access, printing, archiving, or database
access. In the general case, some machines install only client software, others only server
software, and still others may include both client and server software. However, it is more
common that client and server software usually run on separate machines. Two main types of
basic DBMS architectures were created on this underlying client/server framework: two-tier and
three-tier.

 Two-Tier Client/Server Architecture is the simplest client/server application. In this


architecture the client processes provide an interface for the user, and gather and present data
usually either on a screen on the user's computer or in a printed report. The server processes
provide an interface with the data storage. The logic that validates data, monitors security and
permissions, and performs other business rules can be fully contained on either the client or
the server, or partly on the client and partly on the server. The exact division of the logic
varies from system to system. The logic for the application can also be designed to form a
separate middle tier. Applications that are designed with separate middle tier have three
logical tiers but still run into two physical tiers. The middle tier may be contained in either
the client or the server. Client/server applications that are designed to run the user and

6 Fundamentals of Database System


Wachemo University__Department of Computer Science

business tiers of the application on the client side, and the data tier on the server side are
known as fat client applications. On the other hand, applications that are designed to run the
user tier on the client side and the business and data tiers on the server side are known as thin
client applications. Though fat and thin client/server architectures have three tiers, such
applications are intended to run on two computers as two physical tiers. If the three tiers are
separated so that the application can be run on three separate computers, the implementation
is known as a three-tier application.

 Three-Tier Client/Server Architecture is an application that has three modularly separated


tiers that can be run on three machines. The standard model for a three-tier application has
User tier (GUI or Web Interface), Business tier (Application Server or Web Server) and Data
tier (Data Server).
 User tier presents the user interface for the application, displays data and collects user
input. It also sends and requests for data to the next tier. It is often known as the
presentation tier.
 The business tier incorporates the business rules for the application. It receives requests
for data from the user tier, evaluates them against the business rules and passes them on
to the data tier. It then receives data from the data tier and passes back to the user tier. It
is also known as the business logic tier.
 And finally at the base, the data tier comprises the data storage and a layer that passes
data from the data storage to the business tier and vice versa. It is also known as the
data tier.

Fig 1.6: Logical three-tier client/server architecture for a web application

7 Fundamentals of Database System

You might also like