0% found this document useful (0 votes)
20 views40 pages

Lecture2 Database Environment

Uploaded by

anaslyricist
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views40 pages

Lecture2 Database Environment

Uploaded by

anaslyricist
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Database Management System

Database Environment

These slides are adapted from Operating Systems,a practical approach to design,
implementations and management: Thomas Connolly : © 2005
Objectives
To learn:
• Purpose of three-level database architecture.
• Contents of external, conceptual, and internal levels.
• Meaning of logical and physical data independence.
• A classification of data models.
• Purpose/importance of conceptual modeling.
• Typical functions and services a DBMS should provide.
• Function and importance of system catalog.
• Meaning of client–server architecture and advantages of this type of
architecture for a DBMS.
Data, Database, Data Model and DBMS

End users
Software interact

Application
Application
Programmers
Programs develop
“What” to
get
Database
DBMS
maintain Administrators
“How” to
Data get

Database
Database design Designers

Users
slide adopted from Database Management Systems - CS403 VU Power Point Slides
© Virtual University of Pakistan
Three-Level Architecture
• Identification of three levels of abstraction, that is, three distinct
levels at which data items can be described.
• The levels form a three-level architecture comprising an external, a
conceptual, and an internal level.
ANSI-SPARC Three-Level Architecture
• External Level
– Users’ view of the database.
– Describes that part of database that is relevant to a particular
user.

• Conceptual Level
– Community view of the database.
– Describes what data is stored in database and relationships
among the data.
– It is a complete view of the data requirements of the
organization that is independent of any storage considerations.
Employee Data
Workers
Saleema
First Name: Rana Name: R. Aslam
Last Name: Aslam Age: 25y,10d
Date of Birth: Dept: Sales
12 Sep, 1970

Saleem

External Layer

Lower Layers

Slide adopted from Database Management Systems - CS403 VU Power Point Slides Lecture
© Virtual University of Pakistan
Employee Data Saleema
Workers
First Name: Rana
Name: R. Aslam
Last Name: Aslam
Age: 24y,10d
Date of Birth:
Dept: Sales
12 Sep, 1970

Saleem
External Layer
Logical Record Interface

Conceptual Layer

Name DoB Deps DepId


Rana Aslam 12/09/70 5 D001
Marya Wasti 29/02/80 0 D005
Slide adopted from Database Management Systems - CS403 VU Power Point Slides Lecture
© Virtual University of Pakistan
ANSI-SPARC Three-Level Architecture
• Internal Level
– Physical representation of the database on the computer.
– Describes how the data is stored in the database.
– It covers the data structures and file organizations used to store
data on storage devices.
– It interfaces with the operating system access methods to place
the data on the storage devices, build the indexes, retrieve the
data, and so on.
Differences between Three Levels of ANSI-SPARC Architecture
ANSI-SPARC Three-Level Architecture
Objectives of Three-Level Architecture
• All users should be able to access same data.
• A user’s view is immune to changes made in other views.
• Users should not need to know physical database storage details.
• DBA should be able to change database storage structures without
affecting the users’ views.
• 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.
Data Independence
• 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.
Data Independence
• Physical Data Independence
– Refers to immunity of conceptual schema to changes in the internal
schema.
– Internal schema changes (e.g. using different file organizations,
storage structures/devices).
– Should not require change to conceptual or external schemas.
Data Independence and the ANSI-SPARC Three-Level Architecture
Database Languages
• A data sublanguage consists of two main parts: a DDL and a DML.
• They do not include constructs for all computing needs which are provided by
the high-level programming languages.

• Data Definition Language (DDL)


– Specify database schema.
– Allows the DBA or user to describe and name entities, attributes, and
relationships required for the application
– plus any associated integrity and security constraints.
– DDL statements results in a set of tables stored in special files collectively
called the system catalog.
System Catalog - metadata
• A system catalog, is a repository of information describing the data in the
database: it is, the ‘data about the data’ or metadata.
• The system catalog describes objects in the database.
• Typically, the system catalog stores:
• names, types, and sizes of data items;
• names of relationships;
• integrity constraints on the data;
• names of authorized users who have access to the data;
• usage statistics
• data dictionary and data directory
Database Languages
• Data Manipulation Language (DML)
– Provides basic data manipulation operations on data held in the database
usually include the following:
• insertion of new data into the database;
• modification of data stored in the database;
• retrieval of data contained in the database;
• deletion of data from the database.
Database Languages
• Procedural DML
– A language that allows the user to tell the system what data is needed
and exactly how to retrieve the data

• Non-Procedural DML
– A language that allows the user to state what data is needed rather than
how it is to be retrieved.

• Fourth Generation Languages (4GLs)


Data Model
• An Integrated collection of concepts for describing data, relationships
between data, and constraints on the data in an organization.
• A model is a representation of ‘real world’ objects and events, and their
associations. It is an abstraction of the essential aspects of an organization.
• Data Model comprises:
– a structural part;
– a manipulative part;
– possibly a set of integrity rules.
Data Model
• Purpose
– To represent data in an understandable way.

• Categories of data models include:


– Object-based
– Record-based
– Physical.
Data Models
• Object-Based Data Models: uses concepts such as entities, attributes, and
relationships.
– Entity-Relationship
– Functional
– Object-Oriented

• Record-Based Data Models: consists of a number of fixed-format records


possibly of differing types
– Relational Data Model
– Network Data Model
– Hierarchical Data Model.
• Physical Data Models
Relational Data Model
• The relational data model is based on the concept of mathematical
relations.
• In the relational model, data and relationships are represented as tables,
each of which has a number of columns with a unique name.
• Relational data model requires only that the database be perceived by the
user as tables. However, this perception applies only to the logical
structure of the database.
• There is no explicit link or relation between two tables
Relational Data Model
Network Data Model
• In the network model,
• data is represented as collections of records, and
• relationships are represented by sets.

• Compared with the relational model, relationships are explicitly modeled


by the sets, which become pointers in the implementation.
Network Data Model
Hierarchical Data Model
• The hierarchical model is a restricted type of network model.
• Data is represented as collections of records and relationships are
represented by sets. However, the hierarchical model allows a node to
have only one parent.
• A hierarchical model can be represented as a tree graph, with records
appearing as nodes (also called segments) and sets as edges.
Hierarchical Data Model
Multi-User DBMS Architectures
1. Teleprocessing
2. File-server
3. Client-server
Teleprocessing
• Traditional architecture
• Single mainframe with a number of terminals attached.
• User terminals are incapable of functioning on their own
• Trend is now towards downsizing.
File-Server
• File-server is connected to several workstations across a network.

• Database resides on file-server.

• DBMS and applications run on each workstation.

• Disadvantages include:
– Significant network traffic.
– Copy of DBMS on each workstation.
– Concurrency, recovery and integrity control more complex.
File-Server Architecture
Traditional Two-Tier Client-Server
• Client (tier 1) manages user interface and runs applications.
• Server (tier 2) holds database and DBMS.
• Client process requires some resource, and a server provides the resource.
• Alternative client-server topologies
• Advantages include:
– wider access to existing databases;
– increased performance;
– possible reduction in hardware costs;
– reduction in communication costs;
– increased consistency.
Traditional Two-Tier Client-Server
Traditional Two-Tier Client-Server
The operations of client and server are;
Traditional Two-Tier Client-Server
Three-Tier Client-Server
• Client side presented two problems preventing true scalability:
– ‘Fat’ client, requiring considerable resources on client’s computer to run
effectively.
– Significant client side administration overhead.

• By 1995, three layers proposed, each potentially running on a different


platform.
Three-Tier Client-Server
1. The user interface layer, which runs on the end-user’s computer (the client).
2. The business logic and data processing layer. This middle tier runs on a server
and is often called the application server.
3. A DBMS, which stores the data required by the middle tier. This tier may run
on a separate server called the database server.
Three-Tier Client-Server
• Advantages:
– ‘Thin’ client, requiring less expensive hardware.
– Application maintenance centralized.
– Easier to modify or replace one tier without affecting others.
– Separating business logic from database functions makes it easier
to implement load balancing.
– Maps quite naturally to Web environment.
Three-Tier Client-Server
Review Questions

1. explain the concept of database schema and discuss the three types of schema in a database.
2. What are data sublanguages? Why are they important?
3. What is a data model? Discuss the main types of data model.
4. Discuss the function and importance of conceptual modeling.
5. Describe the types of facility that you would expect to be provided in a multi-user DBMS

You might also like