Chapter 2
Chapter 2
Chapter Two
Database System Concepts and Architecture
Database System Concepts
and Architecture
Objectives of the chapter
2
Database System Concepts and Architecture
One of the main characteristics of the database approach is that it provides some levels of
data abstraction.
A data model is a collection of concepts that can be used to describe the structure of a
database to achieve the data abstraction.
The structure of a database means the data types, relationships, and constraints that should
hold for the data.
Most data models also include a set of basic operations for specifying retrievals, insertion
and updates on the database.
3
Categories of data models
Many data models have been proposed, which can be categorized according to the types of
concepts they use to describe the database structure.
Describing
Data
Data relationship
Data semantics
Data constraints
Categories of data models
Object-based
Record-based
Physical
4
Cont..
An attribute represents some property of interest that further describes an entity, such as
employee’s name or employee’s salary.
5
Schemas, Instances and Database State
In any data model, it is important to distinguish between the descriptions of the database and
The description of a database is called the database schema, which is specified during
database.
Data type of each item, relationships among the various files and some constraints are not
6
specified in schema diagrams.
Example of a Database Schema
The data in the database at a particular moment is called a database state or snapshot.
Whenever a new database is defined, we specify its database schema only to the DBMS.
Every time when an update operation is applied to the database, we get another database
state.
8
Example of a database state
9
The Three-Schema Architecture
The goal of the 3-schema architecture is to separate the user application and the physical
database. In this architecture, schemas can be defined at the following 3 levels.
10
Cont..
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 the
data storage and access paths for the database.
The conceptual level has a conceptual schema, which describes the structure of the whole
database.
The conceptual schema hides the details of physical storage structures and concentrates on
describing entities, data types, relationships, user operations, and constraints.
The external or view level includes a number of external schemas or user views.
11
Cont..
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.
In a DBMS, based on 3-schema architecture, each user group refers only to its own external
schema.
Hence 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.
The process of transforming requests and results between levels are called mappings.
12
Data Independence
The capacity to change the schema at one level of a database system without changing the
schema at the next higher level.
13
Logical data independence
Logical data independence is the capacity to change the conceptual schema without having to change the
external schemas or application programs.
The changes like expanding the database, changing constraints, removing a record type or a data item,
etc….
In the conceptual schema, should not be affected in the external schemas.
Only the view definition and the mappings need changes in a DBMS that supports data independence.
The changes like file location, access path doesn’t alter the conceptual schema.
14
DBMS Languages
Once the design of a database is completed, and a DBMS is chosen to implement the database,
the first step is to specify conceptual and internal schemas for the database and any mappings
between the two.
The Data Definition Languages (DDL) is used by the DBA and Database designers to define
internal and conceptual schemas.
The DBMS will have a DDL compiler to process DDL statements in order to identify
descriptions of the schema construct and to store the schema descriptions in the DBMS catalog.
In DBMSs, where a clear separation is maintained between the conceptual and internal levels,
the DDL is used to specify the conceptual schema only.
Typical DDL include Create, Alter, Drop, and Rename of the database.
15
Cont…
Another Storage Definition Language (SDL) is used to specify the internal schema.
But in most DBMSs, the DDL is used to define both conceptual and external schemas.
The DBMS provides a Data Manipulation Language (DML) for the users to manipulate
the database.
Typical manipulations include retrieval, insertion, deletion, and modification of the data.
The current DBMSs, a comprehensive integrated language called the SQL relational
database language represents a combination of DDL, VDL, DML and some features also.
16
Cont…
The SDL was a component in early versions of SQL, but has been removed from the language to keep it at the
conceptual and external levels only.
Data Control Language: Database is a shared resource that demands control of data access and usage.
DCL are commands that will help the Database Administrator to control the database.
The database administrator should have the facility to control the overall operation of the system
17
DBMS Interfaces
User friendly interfaces provided by a DBMS may include the following:-
1) Menu based Interfaces for the web clients or browsing :-These interfaces present the user
with lists of options (called menus) that lead the user through the formulation of a request.
In menu based interfaces, the query is composed step-by-step by picking options from a menu
that is displayed by the system.
2) Forms-Based Interfaces :-A form based interface displays a form to each user.
Users can fill out all of form entries to insert new data.
Many DBMSs have special languages called as form specification languages that help
programmers to specify such forms.
18
DBMS Interfaces
3) Graphical User Interfaces (GUI) :-GUI typically displays a schema to the user in
diagrammatic form.
The user then can specify a query by manipulating the diagram. In many cases, GUIs utilize
both menus and forms.
19
Cont..
5) Speech Input and Output:-The speech input is detected using a library of 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) Interface for the DBA:-Most database systems contain privileged commands that can
be used only by the DBA’s staff. These include commands for creating accounts, setting
system parameters, granting account authorization, changing a schema, and reorganizing
the storage structures of a database.
20
Components of DBMS environment
Hardware: like personal computers, mainframe or any server computers, network infrastructure, and other peripherals required in the
system.
Software: include DBMS software, application programs, operating systems, network software, language software and other relevant
software.
Operational data is the data actually stored in the system to be used by the user.
Metadata is the data that is used to store information about the database itself.
Procedure is the rules and regulations on how to design and use a database.
People: play a role in designing, implementing, managing, administering and using the resources in
the database.
21
The database system Environment
The below given figure shows the general component modules of a DBMS and their
interactions.
22
Cont.…
23
Cont..
The top half of the above figure refers to the various users of the database environment and
their interfaces.
The lower half shows the internals of the DBMS responsible for storage of data and
processing of transactions.
The top half shows interfaces for DBA staff, casual users who work with interactive
interfaces to formulate queries, application programmers who program using some host
languages and parametric users who do data entry work by supplying parameters to
predefined transactions.
24
Centralized and Client/Server Architectures for DBMS
Centralized database system:
The centralized database system consist of a single processor together with it associated data
storage devices and other peripherals. It is physically confined to a single location.
The data can be accessed from the multiple sites with the use of a computer network.
Disadvantages of centralized database system::
When the central site computer or database system goes down, then everyone is blocked
from using the system until the system comes back. Expensive in its communication cost.
Client server dbms:
It has two logical components namely client and server.
Client is generally personal computer or workstations whereas server is large workstations,
mini range computer system or a mainframe computer system.
The application and tools of DBMS run on one or more client platforms, while the DBMS
25
software's reside on the server.
Cont.…
ADVANTAGES:
CLIENT / SERVER system has less expensive platforms to support applications.
Client/ server environment facilities in more productive work by the users and
making better use of existing data.
It is more flexible as compared to the centralized systems.
A single server can be shared across several distinct client (application) system.
DISADVANTAGE:
Programming cost is high in client / server environment, particularly in initial phases.
There’s a lack of management tools for diagnosis, performance monitoring and tuning
and security control, for the DBMS client and OS and networking environments.
26
Classification of DBMS
Based on the data model DBMS can be:
Relational
Object
Object-relation
Hierarchical,
Network and others
Based on the number of users supported by the DBMS, it can be:
Single-user DBMS
Multi-user DBMS
Based on the number of sites over which the database is distributed, DBMS can be:
Centralized DBMS,
Distributed DBMS
27
28