0% found this document useful (0 votes)
33 views52 pages

Chapter 2-DATABASE SYSTEM Architecture

This document provides an overview of database system architecture and data models. It discusses key concepts like data abstraction, data models, schemas and instances. It covers different categories of data models including hierarchical, network, relational and object-oriented models. Each data model builds upon the previous to address shortcomings. Data models provide a conceptual representation of real-world data to facilitate communication between users and designers.

Uploaded by

ZELE MIHERET
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
33 views52 pages

Chapter 2-DATABASE SYSTEM Architecture

This document provides an overview of database system architecture and data models. It discusses key concepts like data abstraction, data models, schemas and instances. It covers different categories of data models including hierarchical, network, relational and object-oriented models. Each data model builds upon the previous to address shortcomings. Data models provide a conceptual representation of real-world data to facilitate communication between users and designers.

Uploaded by

ZELE MIHERET
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 52

Fundamentals of Database

system

Chapter Two:
DATABASE SYSTEM
Architecture
 Data models, Schemas, and Instances
 Over view of data models
 Architecture and Data Independence
 Database Language and Interface
 The Database System Environment
 Classification of DBMS
Data Model, Schemas, a database state

 One of the main characteristics of the database approach is to


support data abstraction so that different users can perceive data
at their preferred level of detail.
 Data abstraction generally refers to the suppression of
details of data organization and storage, and the highlighting of
the essential features for an improved understanding of data.
 A data model—a collection of concepts that can be used to
describe the structure of a database provides the necessary
means to achieve this abstraction. structure of a database we
mean the data types, relationships, and constraints that apply to
the data.
… cont.

 Most data models also include a set of basic operations


(insert, delete, modify, or retrieve ) for specifying
retrievals and updates on the database.
 In addition to the basic operations provided by the data
model, it is becoming more common to include concepts
in the data model to specify the dynamic aspect or
behavior of a database application. This allows to
specify a set of valid user-defined operations that are
allowed on the database objects.ex: COMPUTE_GPA.
Overview of Data model

 Designers, programmers, and end users see data in


different ways.
 Different views of same data lead to designs that do
not reflect organization’s operation.
 Data modeling reduces complexities of database
design.
 Various degrees of data abstraction help reconcile
varying views of same data.
…cont.
 Data models
– Relatively simple representations of complex
real-world data structures Often graphical
 Model: an abstraction of a real-world object or
event
– Useful in understanding complexities of the
real-world environment
 Data modeling is iterative and progressive
The Importance of Data Models
 Facilitate interaction among the designer, the applications
programmer, and the end user.
 Data model organizes data for various users and to address
users need.
 Data model is an abstraction: Cannot draw required data out
of the data model.
 Standardize company’s view of data
 Communications tool between users and designers
 Allow designer to understand the nature, role, and scope of
data and to understand business processes
 Allow designer to develop appropriate relationship
participation rules and constraints .
Data Model Basic Building Blocks
 Entity: anything about which data are to be collected and
stored
 Attribute: a characteristic of an entity
 Relationship: describes an association
among entities
– One-to-many (1:M) relationship
– Many-to-many (M:N or M:M) relationship
– One-to-one (1:1) relationship
• Constraint: a restriction placed on the data
Business Rules

 Data Model is populated from Business Rules.


 Descriptions of policies, procedures, or principles within a
specific organization is refer business rule.
– Apply to any organization that stores and uses data to
generate information
 Description of operations to create/enforce actions within
an organization’s environment.
 Must be in writing and kept up to date.
 Must be easy to understand and widely disseminated.
 Describe characteristics of data as viewed by the company.
Discovering Business Rules

 Sources of business rules:


– Company managers
– Policy makers
– Department managers
– Written documentation
 Procedures
 Standards
 Operations manuals
– Direct interviews with end users
Translating Business Rules into
Data Model Components

Generally:
nouns translate into entities
Verbs translate into relationships among entities.
Relationships are bidirectional.
Two questions to identify the relationship type:
– How many instances of B are related to one
instance of A?
– How many instances of A are related to one
instance of B?
Categories of Data Models
 Many data models have been proposed, which we can
categorize according to the types of concepts they use to
describe the database structure.
– High-level or conceptual data models provide concepts that
are close to the way many users perceive data, Representational
data models hide many details of data storage on disk but can be
implemented on a computer system directly.
– low-level or physical data models provide concepts that
describe the details of how data is stored on the computer
storage media, typically magnetic disks. Concepts provided by
low-level data models are generally meant for computer
specialists, not for end users,
 Conceptual data models use concepts such as entities,
attributes, and relationships.
– An entity represents a real-world object or concept, such as
an employee or a project from the mini-world that is described
in the database.
– An attribute represents some property of interest that further
describes an entity, such as the employee’s name or salary.
– A relationship among two or more entities represents an
association among the entities, for example, a works-on
relationship between an employee and a project.
 Entity-Relationship model: a popular high-level conceptual
data model.
..cont…

 The available data models in commercial database


systems under the categories of High-level or conceptual
data models are:
– Hierarchical models
– Network data model
– Relational data model,
– object data model
The Hierarchical Model

 Developed in the 1960s to manage large


amounts of data for manufacturing projects
 Basic logical structure is represented by an
upside-down “tree”
 Hierarchical structure contains levels or
segments or children's/leaf
– Segment analogous to a record type
– Set of one-to-many relationships between
segments
Cont..

 Foundation for current data models


 Disadvantages of the hierarchical model:
– Complex to implement
– Difficult to manage
– Lacks structural independence
– Relationships do not conform to 1:M form
– No standards for how to implement
The Network Model

 Created to represent complex data relationships


more effectively.
– Improves database performance.
– Imposes a database standard
 Conference on Data Systems Languages
(CODASYL) created the DBTG
 Database Task Group (DBTG): defined
environment to facilitate database creation
Cont…

 Resembles hierarchical model


– Record may have more than one parent
 Collection of records in 1:M relationships
 Set composed of two record types
– Owner
– Equivalent to the hierarchical model’s parent
– Member
– Equivalent to the hierarchical model’s child
Cont…

 Disadvantages of the network model


– Cumbersome or bulky
– Lack of ad hoc query capability placed burden
on programmers to generate code for reports.
– Structural change in the database could
produce destruction or disorder in all application
programs.
The Relational Model

 Developed by E. F. Codd (IBM) in 1970


 The Relational model uses a collection of tables and relationship
among  those tables. 
 Table (relations)
– Matrix consisting of row/column intersections
– Each row in a relation called a tuple
 Relational models considered impractical in
1970
 Model conceptually simple at expense of
computer overhead.
 Relational data management system (RDBMS)
– Performs same functions provided by
hierarchical model
– Hides complexity from the user
 Relational diagram
– Representation of entities, attributes, and
relationships
 Relational table stores collection of related entities
Cont…

 SQL-based relational database application


involves three parts:
– User interface
 Allows end user to interact with the data
– Set of tables stored in the database
 Each table is independent from another
 Rows in different tables related based on
common values in common attributes
– SQL “engine”
 Executes all queries
The Object-Oriented (OO) Model

 Data and relationships contained in single


structure known as an object
 OODM (object-oriented data model) is the
basis for OODBMS
– Semantic data model
 Objects contain operations
 Object is self-contained: a basic building block for
autonomous structures
 Object is an abstraction of a real-world entity
Cont..

 Attributes describe the properties of an object


 Objects that share similar characteristics are
grouped in classes
 Classes are organized in a class hierarchy
 Inheritance: object inherits methods and
attributes of parent class
 UML based on OO concepts that describe
diagrams and symbols
– Used to graphically model a system
Data Models: A Summary

 Common characteristics:
– Conceptual simplicity with semantic completeness
– Represent the real world as closely as possible
– Real-world transformations must conform with
consistency and integrity characteristics
 Each new data model capitalized on the
shortcomings of previous models
 Some models better suited for some tasks
Schemas, Instances, and Database State

 In any data model, it is important to distinguish between the


description of the database and the database itself. The
description of a database is called the database
schema, which is specified during database design and is not
expected to change frequently.
 Schemas is the structure of a database we mean data types,
relationships, and constraints that hold a database. which is
important to distinguish between the description of the
database and the database itself.
 Most data models have certain conventions for displaying
schemas as diagrams is called a schema diagram.
…cont.

 The actual data in a database may change quite


frequently and is called a database state or snapshot. It is
also called the current set of occurrences or instances
in the database. for example, the STUDENT construct
will contain the set of individual student entities (records)
as its instances.
Three-Schema Architecture and Data Independence

 Three of the four important characteristics of the database


approach, listed chapter 1are: (1) use of a catalog to store
the database description (schema) so as to make it self-
describing, (2) insulation of programs and data (program-
data and program-operation independence), and (3)
support of multiple user views.
 In this section we specify an architecture for database
systems, called the three-schema architecture,9 that was
proposed to help achieve and visualize these
characteristics.Then we discuss the concept of data
independence further.
The Three-Schema Architecture

The goal of the three-schema architecture, is to separate the


user applications from the physical database. In this
architecture, schemas can be defined at the following three
levels of abstraction:
1.External level
2.Conceptual level
3.Internal level
1. The external or view level

 The external or view level includes a number of


external schemas or user views. 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. ER
diagrams is popular for represent external views.
 End users’ view of the data environment
 External schema: specific representation of
an external view of Entities, Relationships, Processes and
Constraints
 Easy to identify specific data required to support each
business unit’s operations.
 Facilitates designer’s job by providing feedback about
the model’s adequacy.
 Ensures security constraints in database design.
 Simplifies application program development
2. The conceptual level

 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
Usually, a representational data model is used to describe
the conceptual schema when a database system is
implemented.
 This implementation conceptual schema is often based on a
conceptual schema design in a high-level data model.
…The Conceptual Model

 Represents global view of the entire database


 All external views integrated into single global
view: conceptual schema
 ER model most widely used
 ERD graphically represents the conceptual
schema
…cont

 Provides a relatively easily understood worldwide level


view of data environment
 Independent of both software and hardware
– Does not depend on the DBMS software used to
implement the model
– Does not depend on the hardware used in the
implementation of the model
– Changes in hardware or software do not affect
database design at the conceptual level
3. The Internal level

 The internal level has an internal schema, which describes


the physical storage structure of the database.
 The internal schema uses a physical data model and
describes the complete details of data storage and access
paths for the database.
 Representation of the database as “seen” by
the DBMS
– Maps the conceptual model to the DBMS
 Depends on specific database software
– Change in DBMS software requires internal
model be changed
The Physical Model

 Operates at lowest level of abstraction


– Describes the way data are saved on storage
media such as disks or tapes.
 Requires the definition of physical storage
and data access methods.
 Relational model aimed at logical level.
– Does not require physical-level details.
 Physical independence: changes in physical
model do not affect internal model
Data Independence

 The three-schema architecture can be used to further


explain the concept of data independence, which can be
defined as the capacity to change the schema at one level
of a database system without having to change the
schema at the next higher level. We can define two types
of data independence:
 Logical Data Independence Capacity to change the
conceptual schema without changing the application
programs or external schema.
 Physical data independence Capacity to change the
internal schema without changing the conceptual schema
DBMS Languages

 These SQL commands are mainly categorized into four


categories as:
– DDL – Data Definition Language: Used by DBA and
Database designers to define both conceptual and
internal schemas.
– DQl – Data Query Language: DML statements are
used for performing queries on the data within schema
objects. The purpose of DQL Command is to get some
schema relation based on the query passed to it. Like
SELECT – is used to retrieve data from the a database.
 DML – Data Manipulation Language: for retrieval ,
insertion, deletion and modification of the data.
 DCL(Data Control Language) : DCL includes
commands such as GRANT and REVOKE which mainly
deals with the rights, permissions and other controls of
the database system. Examples of DCL commands:
– GRANT-gives user’s access privileges to database.
– REVOKE-withdraw user’s access privileges given by
using the GRANT command.
Interfaces

 Menu based Interfaces


 Forms-based Interfaces
 Graphical User Interfaces
 Interfaces for DBA
 Thank you

You might also like