7/4/2024
IT 220: Database
Management System
Unit 1: Database Concepts and Architecture
Topics
• Database, Database Management System, Database Users, Database
Administrator, Advantages of Databases
• Data Models, Schemas, and Instances; Three-Schema Architecture
and Data Independence
• Database Languages and Interfaces
• The Database System Environment
• Centralized and Client/Server Architectures for DBMSs
• Classification of Database Management Systems.
1
7/4/2024
Introduction to DBMS
The collection of data related to any particular enterprise usually referred as the
database
Collection of interrelated data and a set of programs to access those data is
DBMS
a software package designed to define, manipulate, retrieve and manage data
in a database is DBMS Software
Oracle, MSSQL, MySQL,
DB are designed to manage large and vague information properly
Database System Application
Banking
Airlines
Universities
Telecommunication
Finance
Sales
Credit & Transaction
Manufacturing
Human Resources
2
7/4/2024
Purpose of Database System
Provide a convenient and effective method of defining, storing or
constructing, and retrieving or manipulating database for various
applications.
To reduce data redundancy and inconsistency
Easily access the data
To provide data security.
To preserve consistency of database (integrity constraint)
Disadvantage of file system
Data redundancy and inconsistency.
Difficulty in accessing data
Data Isolation
Integrity problem
Atomicity problem
Concurrent access anomalies
Security problems.
3
7/4/2024
Advantages of DBMS
Data redundancy can be reduced.
Inconsistency can be avoided
Simplicity in data sharing (among different users)
Security can be maintained
Integrity can be maintained
Standard can be enforced
Providing backup and recovery and many more…
Data category
Structure Data: Data that has a structure and is well organized either
in the form of tables or other way and can be easily operated. Fast
processing of the data.
Relational database, spreadsheet are the example of structured data.
Semi-Structured Data: Structured data but not organized. Difficult
to retrieve, analyze due to un-organized.
XML files, .csv, tab delimited files are the example of semi-structured
data.
Unstructured Data: data that is unstructured or unorganized which
is difficult to access, search and requires advance software to access
them.
Image, word file, pdf documents are the example of Unstructured data.
4
7/4/2024
Data Abstraction
Data abstraction is the way of hiding the certain details of how the data are
stored and maintained.
Many DB system users are not computer trained, so developers hide
certain complexity from user.
Complexity should be hidden from the user.
Different level of abstraction are used to simplify user’s interaction with DB
system
Cont…
View Level
View 1 View 2 ….. View n
Logical
Level
Physical
Level
Figure: Three Levels of Data Abstraction
10
5
7/4/2024
cont…
Internal or Physical Level
describes how the data are actually stored
Complex data structure details
Logical Level
Describe what data are stored in database
describe relationship among the data.
Database Administration Level
View Level
Describes the parts of the database for a particular group of users.
Many different views of the database
11
Instances & Schemas
Databases change over time as information is inserted and deleted. The
collection of information stored in a database at a particular moment is
called instances of a database.
The overall design of the database is called schema.
Three types of schema: physical schema, logical schema, view schema.
Physical: how the data stored in blocks of storage
Logical: Programmers and DBA works at this level
View: Describes end user interaction with database.
12
6
7/4/2024
Data Independence
Physical Data Independence
The ability to change the physical schema without changing the
logical schema .
Physical schema include: using new storage devices, using different
storage structure, modifying indexes etc.
Logical Data Independence
The ability to change the logical schema without changing the
external schema or application program.
To update the conceptual schema like adding or removing new
entities or attributes without changing the existing external schemas.
13
Data Models
collection of conceptual tools for describing data, data relationships,
data semantics, and consistency constraints.
data model provides a way to describe the design of a database at
the physical, logical, and view levels.
Data model is either physical or conceptual model
Object Based Logical Model
Entity-Relationship Model
Object Oriented Model
Record Based Data Model
Hierarchical Model
Network Model
Relational Model
14
7
7/4/2024
ER Model
The entity-relationship (E-R) data model uses a collection of basic objects,
called entities, and relationships among these objects.
ER Model is used to develop the design of the database.
Display database design in pictorial form.
Shows entities and relationship between entities and among other
attributes.
Different symbol are used to design ER-Model eg: Oval, rectangle, line,
connecter etc.
15
Object Oriented Model
It is based on collection of objects, like ER Model. Object Contains
values and bodies of codes, which are called methods.
An object can contain another object to an arbitrarily deep level of
nesting
Object is instance of class.one object is communicate with other
object by sending message.
16
8
7/4/2024
Relational Model
Data and relationship are represent by table.
Each table has multiple columns and each column contain a unique
name.
17
Network Model
database model that is designed as a flexible approach to
representing objects and their relationships
unique feature of the network model is its schema, which is viewed
as a graph where relationship types are arcs and object types are
nodes.
The network model has the ability to manage one-to-one (1:1) as
well as many-to-many (N: N) relationships.
System Complexity: Each and every record has to be maintained with
the help of pointers, which makes the database structure more
complex
18
9
7/4/2024
Hierarchical Model
Similar network model, but organization of record is a collection of
trees, rather than arbitrary graph.
One parent record with many children.
Major drawback is that ,it can have only one to many relationships
between nodes.
Hierarchical databases were popular in early database design, in the
era of mainframe computers.
19
Database Language
Database Languages are the set of statements, that are used to define and
manipulate a database.
A database system provides a data-definition language to specify the
database schema and a data-manipulation language to express database
queries and up-date.
DDL implements database schema at the physical, logical and external
level.
DML provides the statements to retrieve, modify, insert and delete the
data from the database
20
10
7/4/2024
Database Language (DML)
A data-manipulation language (DML) is a language that enables users to access or manipulate data.
It allows to
Retrieval of information stored in the database
Insertion of new information into the database
Deletion of information from the database
Modification of information stored in the database
Types of DML:
Procedural DMLs require a user to specify what data are needed and how to get those data.
Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify what data are needed without
specifying how to get those data.
A query is a statement requesting the retrieval of information. The portion of a DML that involves
information retrieval is called a query language
21
Database Language (DDL)
DDL is a standard for command that defines the different structure in database
The DDL is also used to specify additional properties of the data.
DDL specifies all the schemas, i.e. physical, Logical and view schema. The set of
statements in DDL used to implement database schema are as follow
Create: Command for construction of a relation(table)
Alter: Command for Reconstruction of a relation(table)
Drop: Command for deleting a relation
Truncate: Command to Delete all the entries
rename: Command to rename the relation
It also defines consistency constraints on the data, stored in the database
The constraints specified by DDL are Domain Constraint, Referential Integrity, Assertion and
Authorization constraints
22
11
7/4/2024
Data Control Language (DCL)
• DCL is used to control user access in a database.
• This command is related to the security issues.
• Using DCL command, it allows or restricts the user from accessing data in database
schema.
• DCL commands are as follows:
1. Grant
• GRANT command gives user's access privileges to the database.
• This command allows specified users to perform specific tasks.
2. Revoke
• REVOKE command is used to cancel previously granted or denied permissions.
• This command withdraw access privileges given with the GRANT command.
• It takes back permissions from user.
23
Transaction Control Language (TCL)
• TCL stands for Transaction Control Language.
• This command is used to manage the changes made by DML statements.
• TCL commands are as follows:
1. Commit
• COMMIT command saves all the work done.
• It ends the current transaction and makes permanent changes during the transaction.
2. Rollback
• ROLLBACK command restores database to original since the last COMMIT.
• It is used to restores the database to last committed state.
3. Savepoint
• SAVEPOINT command is used for saving all the current point in the processing of a transaction.
• It marks and saves the current point in the processing of a transaction.
24
12
7/4/2024
Database Interface
• A DBMS interface is a user interface that allows for the ability to input
queries to a database without using the query language itself.
• A DBMS interface could be a web client, a local client that runs on a
desktop computer, or even a mobile application etc.
• Database interfaces are used to define connection details to a
database that has a JDBC driver like Oracle, PostgreSQL or SQL Server.
25
Database User and Administrator
The person who use the database systems are called database user. There
are four different types of user.
1. Naive User
Interact with the system by using previously written program. End user who
interact with DB using certain application software.
2. Application Programmer
Computer professional who writes application programs.
3. Sophisticated Users
They are database developers, who write SQL queries to
select/insert/delete/update data. These users will be scientists, engineers,
analysts who thoroughly study SQL and DBMS to apply the concepts in their
requirement.
4. Specialized Users
These are also sophisticated users, but they write special database application
programs. They are the developers who develop the complex programs to the
requirement.
26
13
7/4/2024
Database User and Administrator
1. Database Administrator
• A person who has central control of both the data and the programs that
access those data over the system is referred as DBA.
• DB Designing, implementing, maintaining, security management and
policy management are key responsibility of DBA
2. Functions of DBA
i. Schema Definition
ii. Storage structure and access method definition
iii. Schema and physical organization modification
iv. Granting authorization for data access
v. Routine Maintenance
1) Periodically backing up database (tapes/remote server)
2) Ensuring free disk space
3) Monitoring jobs running on the database that performance is not degraded
27
Application Architecture
Most users of a database system today are not present at the site of
the database system, but connect to it through a network.
differentiate between client machines, on which remote database
users work, and server machines, on which the database system runs.
two-tier architecture, the application is partitioned into a
component that resides at the client machine, which invokes
database system functionality at the server machine through query
language statements. Application program interface standards like
ODBC and JDBC are used for interaction between the client and the
server.
three-tier architecture, the client machine acts as merely a front end
and does not contain any direct database calls. Instead, the client
end communicates with an application server, usually through a
forms interface.
28
14
7/4/2024
Client Server Architecture
1-Tier Architecture:
• It is the simplest form of Database Architecture where
the Client, Server, and Database all reside on the same
machine.
• Anytime you install a DB in your system and access it to
practice SQL queries it is 1 tier architecture.
• But such architecture is rarely used in production, but
used for development of the local application.
29
Client Server Architecture
• Two-tier Architecture
• The user interface runs on the client and the database is stored on the server.
• The actual application logic (Business and Data access Logic) can run on either the client or
the server.
• Presentation Logic runs on client.
30
30
15
7/4/2024
Client Server Architecture
• Three-tier Architecture
• Consist of three well-defined and separate processes, each running on a different platform:
Presentation Tier, Logic Tier and Data Tier
31
31
Three-tier Architecture Continue
• Presentation Tier:-
• The top most level of the application is the user interface
• The main function of the interface is to translate the tasks and results to something that the user can understand.
• Client only display the GUI and data, but has no part in producing results.
• E.G. DHTML
• Logic Tier:-
• This layer coordinates the application commands, makes logical decisions and evaluations and performs calculations.
• The bulk of the business application logic is stored in one or more servers
• It also moves and processes data between the two surrounding layers.
• E.G. IIS or Apache, web server
• Data Tier:-
• Information is stored and retrieved from a database or a file system.
• The information is passed back to the logical tire for processing and then eventually back to the user.
• E.G. Database server
32
32
16
7/4/2024
Tier Architecture
33
Database System Environment
• A database environment is a collective system of components that
comprise and regulates the group of data, management, and use of
data, which consist of software, hardware, people, procedure of
handling database, and the data also.
• A database System Environment consists of following components:
• Data
Database system contains a collection of related data.
Data are raw facts that can be stored in database.
• Hardware
Hardware are the physical components of database system environment that includes
storage devices, processors, input/output devices, network devices, etc.
34
17
7/4/2024
Database System Environment
• Software
Software of database system environment includes database management
software includes operating system, SQL Server, Oracle, MySQL, MS-Access
• Users
This component includes all users of the database system.
Users of database can be System Administrators, database Administrators,
System Analysts and Programmers and End users
• Procedures:
This component is nothing but the functions that regulates and controls the
use of database
35
Database Architecture
The architecture of a database systems is greatly influenced by
the underlying computer system on which the database is running:
• Centralized
• Client-server
• Distributed
• Parallel
36
18
7/4/2024
Centralized Database Architecture
• A centralized database is basically a type of database that is stored and
maintained at a single location only.
• Centralized database is modified and managed by this single location only.
• Remote users can access the centralized database through internet
connection.
• Advantages:
• Data Security
• Reduced data redundancy
• Simple to design
• Less costly
• Disadvantages:
• If the centralized database is failure, then the entire data will be destroyed.
• The data traffic is high
37
Client-Server Architecture
• It consists of two types of computer one is client computer, and
another is server computer.
• Client computers request for the services to the server computer.
• Server computer is responsible for providing services to multiple
client computers.
• One server machine executes work on behalf of multiple client
machines.
• Server is a powerful than client machine since it is responsible for
providing services requested by the clients.
38
19
7/4/2024
Distributed Database Management System
• A distributed database (DDB)is a collection of multiple, logically interrelated
databases distributed over a computer network
• A distributed database management system (DDBMS) is the software that
manages the DDB and provides an access mechanism that makes this distribution
transparent to the users.
• Distributed database must ensure the following:
• The distribution is transparent
• The transaction is transparent.
39
Distributed Database Management System
• The distribution is transparent
• Allows a user to perceive a DDBS as a single, logical entity.
• The user does not need to know the location of data items and a command
used to perform a task is independent from the location of the data and the
site the task is performed.
• The transaction is transparent.
• Ensures that all distributed transactions maintain integrity and consistency of
the DDB and support concurrency.
• Each distributed transaction is divided into a number of sub-transactions(a
sub-transaction for each site that has relevant data) that concurrently access
data at different locations
40
20
7/4/2024
Classification of Database Management
System
• Types of DBMS
• Relational database.
• Object oriented database.
• Hierarchical database.
• Network database.
41
Transaction Management
• A transaction is a set of operations which works on a consistent
database and returns consistent database.
• A transaction is a collection of operations that performs a single
logical function in a database application
• Transaction-management component ensures that the database
remains in a consistent (correct) state despite system failures (e.g.,
power failures and operating system crashes) and transaction failures.
• Concurrency-control manager controls the interaction among the
concurrent transactions, to ensure the consistency of the database.
42
21
7/4/2024
Properties of Transaction(ACID Properties)
• Atomicity:
• Either all of the operations of the transaction are reflected properly in the database, or none are.
• Consistency:
• Execution of transaction in isolation( that is, with no other transaction executing concurrently)
preserves the consistency of the database.
• Isolation:
• Even though multiple transactions may execute concurrently, the system guarantees that, for
every pair of transactions Ti and Tj :
• Either Tj finished execution before Ti started or Tj started execution after Ti finished.
• Thus, each transaction is unaware of other transactions executing concurrently in
the system.
• Durability:
• After a transaction completes successfully, the changes it has made to the database
persist, even if there are system failures.
43
Database System Structure
A database system is partitioned into modules that deal with each of
the responsibilities of the overall system. The functional components
of a database system can be broadly divided into the storage manager
and the query processor components.
The storage manager is important because databases typically
require a large amount of storage space. Corporate databases range
in size from hundreds of gigabytes to, for the largest databases,
terabytes of data.
The query processor is important because it helps the database
system simplify and facilitate access to data. High-level views help to
achieve this goal; with them, users of the system are not be burdened
unnecessarily with the physical details of the implementation of the
system. However, quick processing of updates and queries is
important.
44
22
7/4/2024
45
Storage Manager
program module that provides the interface between the low level
data stored in the database and the application programs and queries
submitted to the system.
responsible for the interaction with the file manager.
raw data are stored on the disk using the file system, which is usually
provided by a conventional operating system.
storage manager translates the various DML statements into low-
level file-system commands.
the storage manager is responsible for storing, retrieving, and
updating data in the database.
46
23
7/4/2024
storage manager components
Authorization and integrity manager: tests for the satisfaction of integrity
constraints and checks the authority of users to access data.
Transaction manager: which ensures that the database remains in a
consistent (correct) state despite system failures, and that concurrent
transaction executions proceed without conflicting.
File manager: which manages the allocation of space on disk storage and
the data structures used to represent information stored on disk.
Buffer manager: responsible for fetching data from disk storage into main
memory, and deciding what data to cache in main memory.
Data files: which store the database itself.
Data dictionary: which stores metadata about the structure of the
database, in particular the schema of the database.
Indices: which provide fast access to data items that hold particular values.
47
Query Processor
The query process components includes:
DDL interpreter, which interprets DDL statements and records the
definitions in the data dictionary.
DML compiler, which translates DML statements in a query language
into an evaluation plan consisting of low-level instructions that the
query evaluation engine understands.
A query can usually be translated into any of a number of alternative
evaluation plans that all give the same result. The DML compiler also
performs query optimization, that is, it picks the lowest cost
evaluation plan from among the alternatives.
Query evaluation engine: which executes low-level instructions
generated by the DML compiler.
48
24
7/4/2024
THE END
49
25