0% found this document useful (0 votes)
32 views37 pages

FDB2

Uploaded by

end
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)
32 views37 pages

FDB2

Uploaded by

end
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/ 37

1

Chapter 2

Database system
architecture
Data models
2

 Data models:- a collection of concepts


that can be used to describe the
structure of a database(data types,
relationships and constraints).
 Data Model provides a means to achieve
Data Abstraction
 Data Abstraction refers to the hiding
of certain details of how the data are
stored and maintained.
levels of abstraction
3

 Physical Level:
 Describes How the data are stored., how is it
accessed
 how data is modified, is data ordered (index, B-
tree, hashing),
 Lowest level of abstraction.
 Conceptual Level:
 Next highest level of abstraction.
 Describes what data are stored.
 Describes the relationships among data.
 Database administrator level.
levels of abstraction
4

 View Level:
 Highest level.
 Describes part of the database for a
particular group of users.
 Can be many different views of a database.
levels of abstraction
5
Categories of Data Model

1. High-level/ Conceptual Data models:


 Provide concepts that are close to the way people

perceive data to present the data.


 Example : entity – relationship model ,object-oriented

 concepts like entities, attributes, and relationships.


 Entity :-represents real-world objects or concepts
(employee, project).
 An entity has some attributes which represents properties
of entity such as employee’s name, address, birth-date.
 A relationship represents association among entities for
example a works on relationship between employee and
project.
Categories of Data Model

2. Record-based /Logical Data models


 Provide concepts that can be understood

by the user but not too far from the way


data is stored in the computer.
 Three well-known Record-based data

models
 Relational data model,
 Network data model and
 Hierarchical data model
8

a) Relational data model


 Data and relationships are represented by a
collection of tables.
 Each table has a number of columns with
unique names, e.g. customer, account
Relational model
9

 Advantages of RDBMS
 Flexible and well-established
 used over many years. thus stable,
standardized products available.
 Standard data access language through
SQL.
 The fundamental structure, i.e., a table, is
easily understood and the design.
Relational model
10

 Weakness of RDBMS
 Performance problems associated with re-
assembling simple data structures into their
more complicated real-world representations.
 Lack of support for complex base types, e.g.,
drawings
 SQL is limited when accessing complex data.
 Knowledge of the database structure is
required to create specific purpose queries.
11

b) Network model
 Data are represented by collections of

records.
 Relationships among data are

represented by links
Network model
12

 advantages of a network database :


 Efficient representation of some structures
 More flexibility than a hierarchical approach
(all relationships can be represented without redundancy).
 allows the modeling of many-to-many relationships.
 Weaknesses of Network Databases :
 machine performance (implementations that perform well
for one type of network may perform poorly for another
type)
 maintainability (changing relationships may require physical
reorganization of data)
 Lack of robustness. A failure in the system can leave
dangling references to data which must somehow be
recovered
 Update overheads.
13

c) Hierarchical model:
 data is represented by a simple tree

structure.
 A parent record can have many child

records but a child record can have only


one parent.
 There are no many-to-many relationships

between records.
Hierarchical model:
14
Hierarchical model:
15
 advantages of a hierarchical database :
 Efficient representation of hierarchical structures,

 Efficient single key search and access time

 Fast update performance where locality of

reference exists
 disadvantages of a hierarchical database :
 Lack of flexibility (non-hierarchical relationships are

awkward to represent; redundancy may be


required),
 Poor performance for non-hierarchical accesses,

 Lack of maintainability

(changing R/ship may require physical change of


data).
16

Object-Oriented Data Model


 The object-oriented model is based on a collection of objects,

like the E-R model.


 An object also contains bodies of code that operate on the

object.
 These bodies of code are called methods.

 Objects that contain the same types of values and the same

methods are grouped into classes.


 A class may be viewed as a type definition for objects.

 The only way in which one object can access the data of another

object is by invoking the method of that other object.


 Internal parts of the object, the instance variables and method

code, are not visible externally.


 Result is two levels of data abstraction.
Object-Oriented Data
17
Model
 Strengths of ODBMS
 Representations of complex structures.
 Storage of complex objects results in better performance.
 The model exhibits better coupling and cohesion characteristics.
 This results in a more maintainable and flexible database.
 Weaknesses of ODBMS
 Lack of maturity in the products. This leads to more risk in
employing the product.
 There is also a lack of product standardization. Database
standards are emerging.
 There is no equivalent of SQL for object-oriented.
 There is much less experience with project development.
 There is no consistent, solid theoretical basis to support ODBMS
products.
Physical Data models
18

3.Physical Data models: Provide


concepts that describe how data is
actually stored in the computer.
Schemas versus Instances
19

 Database Schema
 The description of a database.
 Includes descriptions of the database
structure, data types, and the constraints
on the database.
 Schema Diagram
 An illustrative display of (most aspects of)
a database schema.
 data type and relationships are not
specified.
 Schema Construct
 Each object of the schema , e.g., STUDENT,
COURSE.
Example of a Database
20
Schema
Database state(instance)
21

 Database State (database instance or


occurrence or snapshot).
 The actual data stored in a database at a
particular moment in time.
 The term instance is also applied to
individual database components.
 e.g. record instance,
 table instance,
 entity instance
Example of a database
22
state
Database Schema
vs. Database State
23

 Database State
 Refers to the content of a database at a
moment in time.
 Initial Database State
 Refers to the database state when it is
initially loaded into the system.
 Valid State
 A state that satisfies the structure and
constraints of the database.
Database Schema
vs. Database State
24

 Distinction
 The database schema changes very
infrequently.
 The database state changes every time
the database is updated.

 Schema is also called intension.


 State is also called extension
Database Architecture
25

 Three –level
Architecture(ANSI/SPARC
Architecture
 Proposed to support DBMS characteristics

of:
 Program-data independence.
 Support of multiple views of the data.
 Its goal is to separate the user
applications and the physical database.
Three –level Architecture

26

 a) External level: different views of the database


 Each view is provided for a user or a group of users
 simplifies the interaction between the user and
system.
 b) Conceptual level: describes the logical
structure of the whole database.
 describes the structure of the DB.
 It hides the details of the physical storage structure.
 It also describes the entities, data types,
relationships, constraints and user operations.
 c) Internal level: how the data are actually
stored, how to access the data.
Three –level Architecture
27
Three –level Architecture
28

 Mappings among schema levels are


needed to transform requests and data.
 Programs refer to an external schema, and
are mapped by the DBMS to the internal
schema for execution.
 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)
Data Independence
29

 Data independence:
 the ability to modify the schema in one level without
affecting the schema in the higher level.
 There are two levels of data independence
 Logical data independence : is the ability to make
change in the conceptual schema without causing a
change in the user views or application program .
 Physical data independence :is the ability to
make change in the internal schema without causing
a change in the conceptual schema or application
program .
 Logical data independence is harder to achieve.
Database Languages
30

 Data Definition Language (DDL):


 language for defining the database Or describing the
types of entities and relationships.
 Data Manipulation Language (DML):
 is used to manipulate the database(retrieval, insertion,
deletion, and modification of the data).
 A high-level or non-procedural DML is used on its
own to specify complex database operations in a concise
manner, such as SQL.
 A low-level or procedural DML must be embedded in
a general purpose programming language. This type of
DML typically retrieves individual records or objects from
the database and processes each separately, such as
PL/SQL.
31

 Data Control Language (DCL):


 is a set of commands that generally control
permissions on the data, such as defining
access rights.
DBMS Component
32
Modules
Application
programmers

APPLICATION
DBA Staff Casual users PROGRAMS

Precompiled

DDL STATEMENTS PRIVILEGED COMMANDS INTERACTIVE QUERY Parametric users

Host Language Compiler

DDL Compiler Query Compiler


COMPILED (CANNED)
DML STATEMENTS
TRANSACTIONS

execution

System Catalog/ DML Compiler


Data Dictionary

Run-time Database
execution execution
Processor

Concurrency Control/
Stored Data Manager Backup/Recovery
Subsystems

STORED DATABASE
DBMS Component
33
Modules
 Disk access control
 Stored Data Manager
 OS
 Compilers
 DDL Compiler
 Query Compiler
 DML Compiler
 Precompiler /Host language compiler
 Handling DB access at runtime
 Runtime database processor
Classification of DBMSs
34

 Based on the Database model


 Relational DBMS
 Network DBMS
 Hierarchical DBMS
 Object-oriented DBMS
 Based on the number of users
 Single-user (typically used with personal
computers)
 multi-user (most DBMSs).
Classification of DBMSs
35

 Based on the way the data is


stored(Number of Sites)
 Centralized (uses a single computer with
one database)
 Distributed (uses multiple computers,
multiple databases)
 Homogeneous DDBMS(same DBMS software at
multiple sites)
 Heterogeneous DDBMS(Federated or
Multidatabase Systems)-several autonomous
preexisting databases.
Summary
36

 Data models
 Level of Abstraction

 Categories of Data Model

 Database Architecture

 Data Independence

 Database Languages

 DBMS Component Modules

 Classification of DBMSs
37

Quiz !!

You might also like