0% found this document useful (0 votes)
12 views47 pages

DB Chapter 2

Uploaded by

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

DB Chapter 2

Uploaded by

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

Assosa University

College of Computing & Informatics


Department of Computer Science

Fundamental of Database System

Halimet A.
e-mail: [email protected]

1
Chapter Two: Database System Architecture

❑ Contents
❖Data models, Schemas, and Instances
❖Architecture and Data Independence
❖Database Language and Interface
❖The Database System Environment
❖Classification of DBMS

2
Data Models

Data Model:
✓ A set of concepts to describe the structure of a
database, the operations for manipulating these
structures, and certain constraints that the database
should obey.
✓ it is a collection of concepts that can be used to describe
the structure of the database including data types,
relationships and the constraints that apply on the data.
✓ The purpose is to represent the data requirements of an
organization in away to make the data readily
understandable by variety of users. 3
Cont…

Data Model Operations:

✓ These operations are used for specifying database


retrievals and updates by referring to the constructs of
the data model.

✓ Operations on the data model may include basic model


operations (e.g., generic insert, delete, update) and user-
defined operations (e.g.compute_student_gpa,
update_inventory).
5
Cont…
Supports communication between the users and
database designers.
The major use of data model is to understand the
meaning of the data and to facilitate communication
about the user requirements.
NB:Data model is a map or diagram of entities and their
relationships.

6
Cont…
A data model must posses the following characteristics so
that the best possible data representation can be obtained.
I. Diagrammatic representation of the data model.
II. Simplicity in designing i.e., Data and their relationships
can be expressed and distinguished easily.
III.Application independent, so that different applications
can share it.
IV.Data representation must be without duplication.
V. Bottom-up approach must be followed.
VI.Consistency and structure validation must be
maintained.
7
Categories of Data Models
Data models can be categorized into three major
categories according to the types of concepts they use to
describe the database structure. These are:
1.Conceptual (high-level, semantic) data models:
✓ Provide concepts that are close to the way many
users perceive data.
✓Example: Entity-Relationship model or object-
Oriented model.

9
Cont…

2.Physical (low-level, internal) data models:


✓ Provide concepts that describe details of how data is
stored in the computer.
✓ These are usually specified in an ad-hoc manner
through DBMS design and administration manuals.
3. Implementation(representational) data models:
✓ Provide concepts that fall between the above two,
used by many commercial DBMS implementations
(e.g., relational data models used in many
commercial systems).
10
Cont…

➢ Majority of modern commercial systems are based


on the object or relational paradigm, while the
early DB systems were based on either the network
or hierarchical data models.
Hierarchical model:
▪ The simplest data model
▪ Record type is referred to as node or segment
▪ The top node is the root node.
▪ Nodes are arranged in a hierarchical structure
as sort of upside-down tree.

11
Cont…

▪ The relationship between parent and child is one-


to-many.
▪ Relation is established by creating physical link
between records(each is stored with a predefined
access path to other records).

12
Cont…
Network Model:
▪ Allows record types to have more that one
parent unlike hierarchical model.
▪ It sees records as set members, each set has an
owner and one or more members.
▪ Allows no many-to-many relationship between
entities.

13
Schemas versus Instances
Database Schema: A schema is plan of the database that
specifies the names of the entities and attributes and the
relationship among them.
▪ It is the overall description of the database. The basic
structure of how the data will be stored in the database is
called schema.
▪ Describes how data is to be structured, defined at design
time.
Schema Diagram: An illustrative display of (most aspects
of) a database schema.

14
Cont…
▪ A schema diagram displays only some aspects of a schema,
such as the names of record types and data items, and some
types of constraints.
Database Instance :
❑ The actual data stored in a database at a particular moment
in time.
❑ It contains all the properties that the schema describes as data
values.

15
Cont…
❑ Also called database instance (or occurrence or snapshot).
✓ The term instance is also applied to individual
database components, e.g., record instance, table
instance, entity instance.
✓ The data in the database at a particular moment of
time is called an instance or a database state.
✓ The instances can be changed by certain CRUD
operations as like addition, deletion of data.
✓ It may be noted that any search query will not make
any kind of changes in the instances

16
Cont…

17
The DBMS Architecture
The Three-Schema Architecture:
▪ The goal of the three-schema architecture is to separate the
user applications and the physical database.
There are three types of schemas in DBMS:
Internal/physical schema, conceptual/logical schema, and
External/view schema.
In this architecture, schemas can be defined at the following
three levels
❖ The internal level has an internal schema, which describes
the physical storage structure of the database.

18
Cont…

❖ The internal schema uses a physical data model and


describes the complete details of data storage and
access paths for the database( i.e Typically uses a
physical data model.)

19
Cont…
❖ The conceptual level has a conceptual schema, which
describes the structure of the whole database for a
community of users.
❑ The conceptual schema hides the details of physical
storage structures and concentrates on describing
entities, data types, relationships, user operations,
and constraints.

❑ Uses a conceptual or an implementation data model.

20
Cont…
❖ External schemas at the external level to describe the
various user views.
❑ Usually uses the same data model as the
conceptual schema.
❑ Each external schema describes the part of the

database that a particular user group is


interested in and hides the rest of the database
from that user group.
❑ each external schema is typically implemented

using a representational data model, possibly


based on an external schema design in a high-
level data model. 21
Cont…

Figure: The three-schema architecture


22
Cont…

✓ The three schemas are only descriptions of data; the stored


data that actually exists is at the physical level only.

✓ Programs refer to an external schema and are mapped by


the DBMS to the internal schema for execution.

▪ i. e. the DBMS must transform a request specified on an


external schema into a request against the conceptual
schema, and then into a request on the internal schema
for processing over the stored database.
23
Cont…

✓ Data extracted from the internal DBMS level is


reformatted to match the user’s external view (e.g.,
formatting the results of an SQL query for display in
a Web page)

✓ The processes of transforming requests and results


between levels are called mappings.

24
Database Architecture

Database architecture describes how a database management


system (DBMS) will be integrated with your application.

When designing a database architecture, you must make


decisions that will change how your applications are created.

The basic client/server architecture is used to deal with a


large number of PCs, web servers, database servers and
other components that are connected with networks.

25
Cont…

The client/server architecture consists of many PCs and a


workstation which are connected via the network.

DBMS architecture depends upon how users are connected


to the database to get their request done.

Database architecture can be seen as a single tier or multi-


tier. But logically, database architecture is of two types
like: 2-tier architecture and 3-tier architecture.

26
Cont…

1-Tier Architecture
In this architecture, the database is directly available to the user.

✓ It means the user can directly sit on the DBMS and uses it.

✓ Any changes done here will directly be done on the database


itself. It doesn't provide a handy tool for end users.

✓ The 1-Tier architecture is used for development of the local


application, where programmers can directly communicate
with the database for the quick response.

27
Cont…

2-Tier Architecture
✓ The 2-Tier architecture is same as basic client-server.

✓ In the two-tier architecture, applications on the client end can


directly communicate with the database at the server side.

✓ For this interaction, API's like: ODBC, JDBC are used.

✓ The user interfaces and application programs are run on the


client-side.

28
Cont…

✓ The server side is responsible


to provide the functionalities
like: query processing and
transaction management.

✓ To communicate with the


DBMS, client-side application
establishes a connection with
the server s(ODBC or JDBC)

29
Cont…

3-Tier Architecture
✓ The 3-Tier architecture contains another layer between
the client and server.
✓ In this architecture, client can't directly communicate
with the server.
✓ The application on the client-end interacts with an
application server which further communicates with the
database system.

30
Cont…

✓ End user has no idea about


the existence of the
database beyond the
application server.
✓ The database also has no
idea about any other user
beyond the application.
✓ The 3-Tier architecture is
used in case of large web
application.

31
Data Independence
Data independence can be explained using the three-schema
architecture.
Data independence refers characteristic of being able to
modify the schema at one level of the database system
without altering the schema at the next higher level
We can defined the two types of data independence:
Logical Data Independence:
✓ The capacity to change the conceptual schema without
having to change the external schemas and their
associated application programs.

32
Cont…

✓ For example: adding/modifying/deleting new


attribute
✓ It used to separate the external level from the
conceptual view.
❑Logical data independence occurs at the user
interface level.

33
Cont…
Physical Data Independence:
✓ The capacity to change the internal schema without
having to change the conceptual schema.
✓ Allows to provide logical description of the database
without need of specify physical structure.
✓ For example, the internal schema may be changed when
certain file structures are reorganized, or new indexes are
created to improve database performance.
✓ It used to separate conceptual levels from the internal
levels.
34
Cont…

35
Database Language and Interface
❖ The following five languages are available to specify different
schemas.

1. Data Definition Language (DDL): It is used to specify a


database conceptual schema using set of definitions. It
supports the definition or declaration of database objects.

2. Storage Definition Language (SDL): It is used to


specify the internal schema in the database. The storage
structure and access methods used by the database system
is specified by the specified set of SDL statements.
36
Cont…

3. View Definition Language (VDL): It is used to specify


user’s views and their mappings to the conceptual schema. But
generally, DDL is used to specify both conceptual and
external schemas in many DBMS’s.

❖ There are two views of data:

▪ Logical View—that is perceived by the programmer

▪ Physical View—data stored on storage devices.

37
Cont…

4. Data Manipulation Language (DML): It provides a set of


operations to support the basic data manipulation operations
on the data held in the database.

▪ It is used to query, update or retrieve data stored in a


database.
▪ The part of DML that provide data retrieval is called
query language.

38
Cont…
The DML is of the two types :
1. Procedural DML: It allows the user to tell the system what
data is needed and how to retrieve it.
▪Retrieve data one record-at-a-time;
▪Constructs such as looping are needed to retrieve
multiple records, along with positioning pointers.
2. Non-procedural DML: It allows the user to state what data
are needed, rather than how it is to be retrieved.
▪ For example, the SQL relational language.
▪ Are “set”-oriented and specify what data to retrieve
rather than how to retrieve it.
▪Also called declarative languages.
39
Cont…

5. Fourth-Generation Language (4-GL): It is a compact,


efficient and non-procedural programming language used to
improve the efficiency and productivity of the DBMS. In this, the
user defines what is to be done and not how it is to be done.
The 4-GL has the following components in it. These are :
I. Query languages
II. Report
III. Spread sheets
IV. Database languages
V. Application generators
VI. High level languages to generate application program.
40
DBMS Interfaces

➢ DBMS interface: is a user interface that allows for the ability


to input queries to a database without using the query
language itself.

➢ User-friendly interfaces provided by DBMS may include:

1. Menu-Based Interfaces: These interfaces present the user


with lists of options (called menus) that lead the user through
the formation of a request. Most popular is pull-down menu
and It is for Web Clients or Browsing.
41
Cont…
2. Forms-Based Interfaces
✓ Displays a form to each user.
✓ Users can fill out all of the form entries to insert new data
✓ Designed and programmed for the naive users
3. Graphical User Interface
✓ Displays a schema to the user in diagrammatic form.

✓ It utilize both menus and forms.

✓ It use a pointing device such as mouse, to pick a certain part


of the displayed schema diagram.
42
Cont…
4. Natural language Interfaces
✓ It accept request written in English or some other
language and attempt to understand them.
✓ It has own schema and dictionary of important words. So,
refer to them while interpret the request.
✓ If the interpretation is successful, the interface generates a
high-level query corresponding to the natural language
and submits it to the DBMS for processing.
✓ otherwise a dialogue is started with the user to clarify any
provided condition or request.

43
Cont…
5. Speech Input and Output
✓ The Speech input is detected using predefined words and
used to set up the parameters that are supplied to the
queries.
✓ For output, a similar conversion from text or numbers into
speech takes place.
6. Interfaces for DBA
✓ Most database system contains privileged commands that
can be used only by the DBA’s staff. These include
commands for creating accounts, setting system
parameters, granting account authorization etc.
44
Classification of Database Management Systems

Several criteria used to classify DBMS


I. Based on Data model
II. Based on number of user
III. Based on sites or Data distribution
IV. Based on Cost of Database
V. Based on accessed or usage

45
Cont…
Based on the data model used
▪ Legacy: Network, Hierarchical.
▪ Currently Used: Relational, Object-oriented, Object-relational,
Entity-Relationship Model, semi-data model,
▪ Recent Technologies: Key-value storage systems, NOSQL
systems: document based, column-based, graph-based and key-
value based.
▪ Native XML DBMSs.
Other classifications(the Number of Users)

▪ Single-user system

▪ multiple user system


46
Cont…
Based on database distribution
▪ Centralized (uses a single computer with one database).
multiple users still the DBMS software and the data both
are stores on a single computer site.
▪ Distributed (multiple computers, multiple DBs). These
computer sites are connected via a computer network.
Variations of Distributed DBMSs (DDBMSs):
▪ Homogeneous DDBMS:- This type of a DDBMS has the
same DBMS software at all the distributed sites.
▪ Heterogeneous DDBMS: This type of DDBMS has
different DBMS software for different sites.
47
Cont…

Other classifications(The Type of Use)


▪ Production or Transactional Database Systems.
▪ Decision Support Database Systems.
▪ Data Warehouses.
Other classifications(Database Site Locations)
▪ Centralized database systems.
▪ Parallel database systems.
▪ Distributed database systems.
▪ Client/Server database systems.

48
49

You might also like