DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science...

23
Department of Computer Science DCS COMSATS Institute of Information Technology DBMS and its Architecture Rab Nawaz Jadoon Assistant Professor COMSATS IIT, Abbottabad Pakistan Management Information Systems (MIS)

Transcript of DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science...

Page 1: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

DCS

COMSATS Institute of Information Technology

DBMS and its Architecture

Rab Nawaz JadoonAssistant Professor

COMSATS IIT, Abbottabad

Pakistan

Management Information Systems (MIS)

Page 2: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Lecture Agenda DBMS Architecture

The Three-Level ANSI-SPARC Architecture

External Level

Conceptual Level

Internal Level

Physical Data Organization

Differences between Three Levels of ANSI-SPARC Architecture

Objectives of Three-Level Architecture

Database Schema

Data Independence

Database Languages

Data Models and Conceptual Modeling

Object Based Data Model

Record-based Data Models

Physical Data Models

Page 3: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

DBMS 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.

The starting point for the design of a database must be an abstract and general description of the information requirements of the organization that is to be represented in the database.

Page 4: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Cont…

A database is a shared resource, each user may require a different view of the data held in the database. To satisfy these needs, the architecture of most commercial DBMSs available today is based to some extent on the so-called ANSI-SPARC architecture

Page 5: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Three Level ANSI-SPARC Architecture

The American National Standards Institute (ANSI) Standards Planning and Requirements Committee (SPARC) produced this architecture in 1975 (ANSI, 1975).

It comprising an external, a conceptual and an internal level

External level: The way users perceive the data

Internal level: The way the DBMS and the operating system perceive the data, where the data is actually stored using the data structures and file

Page 6: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Three Level ANSI-SPARC Architecture

Conceptual level: Provides both the mapping and the desired independence between the external and internal levels.

The objective of the three-level architecture is to separate each user’s view of the database from the way the database is physically represented.

Page 7: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

External Level

Describes that part of the database that is relevant to each user.

Users’ view of the database.

Describes that part of database that is relevant to a particular user.

A user may require few attributes and may not need rest of the attributes.

Page 8: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Conceptual Level

Describes what data is stored in database and relationships among the data.

The community view of the database.

It contains logical structure of the database

It represents: All entities, attributes and their relationships

Constraints on data

Semantic information about the data

Security and integrity of data

It does not concern any storage considerations, such as how many bytes occupied

Page 9: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Physical representation of the database on the computer

Describes how the data is stored in the database.

It covers following things:

Storage space allocation for data and indexes

Record descriptions for storage (size)

Record placement

Data compression and encryption techniques

Internet Level

Page 10: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Physical Data Organization

Below the internal level is the Physical Level.

This level is maintained by the Operating System under the direction of the DBMS.

Examples :

Fields are stored contiguously on disk or not.

Page 11: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Differences between Three Levels of ANSI-SPARC Architecture

Page 12: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Objectives of Three-Level Architecture

Same data accessible to all users.

A user’s view is immune to changes made in other views.

Hide physical database storage details from users.

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.

Page 13: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Database Schema

The description of overall database is called database schema.

External Schema

Corresponds to different views of data

Conceptual Schema

Describes entities, attributes, relationships and constraints.

Internal Schema

It is a complete description of the internal model, including definitions of records, indexes and hashing functions.

Page 14: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Data Independence

Major objective of three level architecture is to provide data independence.

Upper levels are unaffected when changes are made in the low levels.

There are two kinds of data independences 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.

Page 15: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

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

Page 16: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Data Independence

Page 17: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Consists of two parts a Data Definition Language (DDL) and a Data Manipulation Language (DML).

Both do not include constructs for all computing needs such as conditional or iterative statements

DDL

Used to specify the database schema

A language that allows the DBA or user to describe and name the entities, attributes, and relationships required for the application, together with any associated integrity and security constraints.

The result of the compilation of the DDL statements is a set of tables stored in special files collectively called the system catalog. The system catalog integrates the metadata, that is data that describes

objects in the database and makes it easier for those objects to be accessed or manipulated.

Database Languages

Page 18: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Database Languages

DML A language that provides a set of operations to support

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

Data manipulation operations include: Retrieval/Selection Insertion Modification Deletion

Procedural DML allows user to tell system what data is needed and exactly how

to retrieve data.

Non-Procedural DML allows user to state what data is needed rather than how it is to

be retrieved.

Page 19: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Data Models and Conceptual Modeling

Data Model

Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization.

Categories of data models include:

Object-based

Record-based

Physical.

Page 20: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Object Based Data Model Object based models use concepts like entities, attributes

and relationships Some of the more common types of object-based data model

are: Entity–Relationship Semantic Functional Object-Oriented.

Entity

It is a distinct object such as a person, thing, place etc in the organization that is to be represented.

Attribute Is the property that describe some aspects of the entity.

Relationship Association between entities.

Page 21: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

• In this model, database consists of a number of fixed format records and each record has a fixed number of fields.

There are three principal types of record-based logical data model

The relational data model, the network data model, and the hierarchical data model.

The hierarchical and network data models were developed almost a decade before the relational data model, so their links to traditional file processing concepts are more evident.

Record Based Data Model

Page 22: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science

Describe how data is stored in the computer, representing information such as record structures, record orderings, and access paths. There

Physical Data Model

Page 23: DBMS and its Architecture - jadoon956.files.wordpress.com€¦ · Department of Computer Science Lecture Agenda DBMS Architecture The Three-Level ANSI-SPARC Architecture External

Department of Computer Science 23