W2. Database Environment

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 40

Database Management System

Database Environment

Content taken from: © Pearson Education Limited 1995, 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.
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.
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.
ANSI-SPARC Three-Level Architecture
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
Data Models
• Object-Based Data Models: uses concepts such as entities, attributes, and
relationships.
– Entity-Relationship
Data Models
• Object-Based Data Models:
– Functional
• Defines all components of an information system in the form of functions.
• Defines data objects, attributes and relationships as so-called database
functions.
Data Models
• Object-Based Data Models:
• Object-Oriented
• It groups its related functionalities together and allows inheriting its
functionality to other related sub-groups.
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
Hierarchical Data 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.
• we identify a parent entity, and its child entity
• best defined for 1:N type of relationships
Hierarchical Data Model

1:N

M:N
Network Data Model
• This is the enhanced version of hierarchical data model
• It helps to address M:N relationship.
• Any child in the tree can have multiple parents here.
• Makes the accessibility to any data easier, complex data can be retrieved
easily and quickly
• If there is any requirement for the changes to the entities, it requires
entire changes to the database
Network Data Model

• Here Project has multiple parents and each department and


supplier have multiple projects.
• if we want to know the department of project X and if we know
SUPPLIER table, we can pull this information.
• SUPPLIER has the information about project X which includes the
departments
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

You might also like