0% found this document useful (0 votes)
11 views

Chapter 2 Database System Concepts and Architecturen

Chapter 2 discusses database system concepts and architecture, focusing on data models, schemas, and instances. It outlines the three-schema architecture, which separates user views from physical data representation, and emphasizes data independence as a key advantage of using a DBMS. The chapter also categorizes data models and explores their historical development, including hierarchical, network, and relational models.

Uploaded by

Joseph Solomon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Chapter 2 Database System Concepts and Architecturen

Chapter 2 discusses database system concepts and architecture, focusing on data models, schemas, and instances. It outlines the three-schema architecture, which separates user views from physical data representation, and emphasizes data independence as a key advantage of using a DBMS. The chapter also categorizes data models and explores their historical development, including hierarchical, network, and relational models.

Uploaded by

Joseph Solomon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

Chapter 2

Database System Concepts and Architecture


Chapter 2. Database System Concepts and Architecture

2.1. Data Models, Schemas and Instances


2.2. Three-Schema Architecture and Data Independence
2.3 History of Data Models
2.4. Database Languages and Interfaces
2.5. The Database System Environment
2.6. Centralized and Client/Server Architectures for DBMSs
2.7. Classification of Database Management Systems
2.8. Functions of DBMS
Data Models, Schemas and Instances

Data Models
• Data Model: a set of concepts to describe the structure of a database, and certain constraints that
the database should obey.

• By structure of a database we mean the data types, relationships, and constraints that should hold
on the data.

• A data model is a description of the way that data is stored in a database.

• Data model helps to understand the relationship between entities and to create the most effective
structure to hold data.

• Most data models also include a set of basic operations for specifying retrievals and updates on the database.
Data Models (Cont’d)

• Data Model is a collection of tools or concepts for describing


• Data
• Data relationships
• Data semantics
• Data constraints
• The main purpose of Data Model is to represent the data in an understandable way.
Categories of Data Models

• We can categorize data models according to the types of concepts they use to describe
the database structure.

Conceptual (high-level, Semantic) data models


• Provide concepts that are close to the way many users perceive data (Also called
entity-based, object-based data models)
• 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, 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 interaction among the
entities
• Entity-Relationship model—a popular high-level conceptual data model
Categories of Data Models (Cont’d)

• Physical (low-level)
• Provide concepts that describe details of how data is stored in the computer
• Meant for computer specialists, not for typical end users
• Implementation (representational)
• Provide concepts that fall between the above two, used by many commercial DBMS
implementations
• Provide concepts that may be understood by end users but that are not too far removed from
the way data is organized within the computer
• Hide some details of data storage but can be implemented on a computer system in a direct
way
• Representational data models represent data by using record structures and hence are
sometimes called record-based data models. Examples: relational data model, network and
hierarchical model
Schemas, Instances, and Database State

Database Schema(Intension)
• The structure of a database that captures data types, relationships and constraints in data
• Refers to a description of database (or intention)
• Specified during database design
• Is independent of any application program
• Since it is used during the database development phase, there is rare tendency of changing
the schema unless there is a need for system maintenance which demands change to the
definition of a relation(changes infrequently
Schemas, Instances, and Database State (Cont’d)

• In the relational model, the schema for a relation specifies its name, the name of
each field (or attribute or column), and the type of each field

• As an example, student information in a university database may be stored in a


relation with the following schema:

Students( sid: string, name: string, login: string, age: integer, gpa: real)
Schemas, Instances, and Database State (Cont’d)

Database Instance or State:

• Also called State or Snap Shot or Extension of the database

• The actual data contained in a database at a given time.

• State of database is changed any time we add, delete or update an item.


Example of a database Schema
Example of a database state
Levels of Data Abstraction –
Three levels ANSI/SPARC (American National Standards Institute/Standards
Planning and Requirements Committee) architecture

• Proposed by an industry committee commonly known as ANSI/SPARC


• The data in a DBMS is described at three levels of abstraction
• The levels form a three level architecture comprising an external, a conceptual and an internal
level.
• The database description consists of a schema at each of these three levels of abstraction: the
conceptual, physical, and external
• Proposed to support DBMS characteristics of:
• Program-data independence.
• Support of multiple views of the data.
• The objective of the three-level architecture is to separate each users view of the database from the
way it is physically represented.
• Not explicitly used in commercial DBMS products, but has been useful in explaining database system
organization
The purpose and origin of the Three-Level database architecture

• All users should be able to access same data. This is important since the database is having a shared data
feature where all the data is stored in one location and all users will have their own customized way of
interacting with the data.

• A user's view is unaffected or immune to changes made in other views. Since the requirement of one user
is independent of the other, a change made in one user’s view should not affect other users.

• Users should not need to know physical database storage details. As there are naïve users of the system,
hardware level or physical details should be a black-box for such users.

• DBA should be able to change database storage structures without affecting the users' views. A change in
file organization, access method should not affect the structure of the data which in turn will have no effect
on the users.
The purpose and origin of the Three-Level database architecture (Cont’d)

• DBA should be able to change conceptual structure of database without affecting


all users. In any database system, the DBA will have the privilege to change the
structure of the database, like adding tables, adding and deleting an attribute,
changing the specification of the objects in the database.

• All the above and many other functionalities are possible due to the three level
ANSI-SPARC architecture.
The three-schema architecture
Three-Schema Architecture (Cont’d)

• Defines DBMS schemas at three levels:


External /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.
• This is the view (or views) of managers and other employees who are the database
users.
• External schemas: At the external level to describe the various user views. Usually
uses the same data model as the conceptual level.
Example: Courseinfo(cid: string, fname: string, enrollment: integer)
Three-Schema Architecture (Cont’d)
Conceptual Level
• Community view of the database.
• Describes what data is stored in database and relationships among the data.
• Concentrates on describing entities, data types, relationships, user operations, and
constraints.
• Conceptual schema:
• This schema combines the different external views into a single, coherent, and
comprehensive definition of the enterprise’s data.
• At the conceptual level to describe the structure and constraints for the whole
database for a community of users. Uses a conceptual or an implementation data
model.
• The conceptual schema (sometimes called the logical schema) describes the stored
data in terms of the data model of the DBMS
• In a relational DBMS, the conceptual schema describes all relations that are stored
in the database
Example of Conceptual Schema

Students(sid: string, name: string, login: string, age: integer, gpa: real)
Faculty(fid: string, fname: string, sal: real)
Courses(cid: string, cname: string, credits: integer)
Rooms(rno: integer, address: string, capacity: integer)
Enrolled(sid: string, cid: string, grade: string)
Teaches(fid: string, cid: string)
Meets In(cid: string, rno: integer, time: string)
Three-Schema Architecture (Cont’d)

Internal/Physical Level:
• Physical representation of the database on the computer.
• The physical layer contains the data files that hold all the data for the database
• The database user does not need to understand how the data is actually stored within the
data files or even which file contains the data item(s) of interest.
• This level describes how the data is stored in the database. The internal level is concerned
with such things as:

• The file organization (e.g., using B-trees for indexing).


• The storage format (e.g., character encoding, data types).
• Storage space allocation for data
• The location of the data files on the disk.
Three-Schema Architecture (Cont’d)

Internal or physical schema:


• Specifies additional storage details. Essentially, the physical schema summarizes how
the relations described in the conceptual schema are actually stored on secondary
storage devices such as disks and tapes.
• We describe physical storage structures and access paths (e.g indexes).
• We must decide what file organizations to use to store the relations and create auxiliary
data structures, called indexes, to speed up data retrieval operations.
• Typically uses a physical data model.
Three-Schema Architecture (Cont’d)

• A sample physical schema for the university database follows:


• Store all relations as unsorted files of records. (A file in a DBMS is either a collection
of records or a collection of pages, rather than a string of characters as in an operating
system.)

• Create indexes on the first column of the Students. Faculty, and Courses relations, the
sal column of Faculty, and the capacity column of Rooms.
Example: Difference between the three levels

External level

Sno. fname lname age Sal.


Staff_no. lname Br.no.

Staff_no. fname lname DOB Sal. Br. No.


Conceptual level

Struct STAFF{
Int staff_no;
Internal level Char fname[15];
Char lname[15];
Struct date date_of_birth;
Flooat sal;
Struct staff *next
};

Difference between the three levels 42


Example (Cont’d)

For University Database


• Conceptual schema:
• Students(sid: string, name: string, login: string, age: integer, gpa:real)
• Courses(cid: string, cname:string, credits:integer)
• Enrolled(sid:string, cid:string, grade:string)

• Physical schema:
• Relations stored as unordered files.
• Index on first column of Students.

• External Schema (View):


• Course_info(cid:string,sid:string,name:string)
Three-Schema Architecture (Cont’d)

• In a DBMS based on the three-schema architecture, each user group refers only to
its own external schema. Hence, the 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. If the
request is a database retrieval, the data extracted from the stored database must be
reformatted to match the user’s external view. The processes of transforming
requests and results between levels are called mappings.
Data Independence and the ANSISPARC Three-Level Architecture

Data Independence
• A very important advantage of using a DBMS is that it offers data independence.
• That is, application programs are insulated from changes in the way the data is
structured and stored.
• Data independence is the capacity to change the schema at one level of a database
system without having to change the schema at the next higher level

• Data independence is achieved through use of the three levels of data abstraction; in
particular, the conceptual schema and the external schema provide distinct benefits in
this area.
• Specifically, data independence means changes in storage structure and data access
technique does NOT affect application program.
Data Independence (Cont’d)
Data Independence (Cont’d)

• Logical Data Independence

• Is the capacity to change the conceptual schema without having to change


external schemas or application programs.
• We may change the conceptual schema to expand the database(by adding new
tables, or columns)

Example:
Original Setup: A Studens table has columns: StudentID, Name, Age.
Change: Add a new column Email to the Students table.
Independence: Existing external views (e.g., a view showing only StudentID and Name)
remain unchanged. Applications relying on those views continue working without updates.
• .
Data Independence (Cont’d)
• Physical Data Independence
• Is the capacity to change the internal schema without having to change the conceptual (or external)
schemas. This means you can change the way data is physically stored without altering the logical view
of the data or the applications that access it.
• Changes to the internal schema may be needed because some physical files had to be reorganized—for
example, by creating additional access structures—to improve the performance of retrieval or update.

Example:
• Original: Data is stored in a row-based format on disk.
• Change: The database administrator changes storage to a column-based format for faster analytics.
• Independence: Applications and users still interact with the database as if it were row-based. No queries
or views need modification.
• Change: Changing the index on the student table's st_id column from a B-tree to a hash index at the
internal schema level.
• The change to the indexing strategy at the internal level does not affect the conceptual schema, the
external schemas, or any of the applications that access the database.
History of Data Models
• A Data Model is a set of concepts that can be used to describe the structure of data in a
database.
• A database model shows the logical structure of a database, including the relationships
and constraints that determine how data can be stored and accessed.

Categories of database models include:

• Object-based
• Record-based
• Physical
Record-based Data Models

• Consist of a number of fixed format records. Each record type defines a fixed number of
fields, Each field is typically of a fixed length. The following are examples of this
database model category.

• Hierarchical Database Model

• Network Database Model

• Relational Database Model


Hierarchical model
• The oldest and the simplest database model
• In hierarchical model, data is organized into a upside-down tree like structure
with each record is having one parent record and many children.
• The top node is the root node
• Record type is referred to as node or segment.
• Records are linked together like an organizational chart
• Each record type has only one owner
• Each record contain multiple fields, where each field may contain either data
values like integer, real, text or a pointer to a record.
• The pointer is not allowed to form a cycle.
• The main drawback of this model is that, it can have only one to many
relationships between nodes.
Hierarchical model (Cont’d)

• A parent node can have more than one child node

• A child node can only have one parent node

• The relationship between parent and child is one-to-many and one-to-one

• Relation is established by creating physical link between stored records (each is stored
with a predefined access path to other records)

• To add new record type or relationship, the database must be redefined and then stored
in a new form.
Sample Hierarchical Model Diagram:

Lets say we have few students and few courses and a course can be assigned to a single
student only, however a student take any number of courses so this relationship becomes
one to many.
Advantages of Hierarchical model

• Hierarchical Model is simple to construct and operate on


• Conceptual simplicity – easy to understand the model layout
• Data independence (a change in a data type will be automatically cascaded throughout the
database by the DBMS, thereby eliminating the need to make changes in the program
segments that reference the changes data type)
• Database integrity – always a link between parent and child
• Efficiency – very efficient when it contains a large volume of data in 1:M relationships and
whose relationships are fixed over time
• Searching of any record in a hierarchical tree is very fast since the hierarchical databases
uses contiguous storage for hierarchical structures.
• Language is simple; uses constructs like GET, GET UNIQUE, GET NEXT, GET
NEXTWITHIN PARENT etc.
Disadvantages of Hierarchical model

• Complex implementation – Programmers and designers need to have detailed knowledge of the
physical data storage characteristics
• Difficult to manage –Any change in a location of data needs change in all application programs
that accesses changes data
• Lacks structural independence
• Complex applications programming and use –
• programmers and end users must know precisely how the data are physically distributed
within the database
• Lack of standards – no standard DDL and no DML
• Navigational and procedural nature of processing
• A programmer still has to write the program to access the account information, but now the
program navigates through the hierarchy e.g. to find the balance of the savings account for a
given customer number.
• Does not support much consistency and security
Disadvantages of Hierarchical model (Cont’d)

• Implementation limitations – difficult to support M:N relationships

• A child node in the tree cannot have more than one parent. So if the same account is
associated with two customers (e.g. a husband and wife have a joint account and also
separate accounts), we cannot link the one account record to two different customer
records. But we can have the account record appearing in two tree branches. This can lead
to duplicated data – and inconsistent data, if the account is not updated in all the
branches.

Fundamentals Database Systems 36


Network Data Model –

• The network database model was created to solve the shortcomings of the hierarchical
database model.
• In this type of model, a child can be linked to multiple parents, a feature that was not
supported by the hierarchical data model.
• The parent nodes are known as owners and the child nodes are called members
• Network Model is same as hierarchical model except that it has graph-like structure rather
than a tree-based structure.
• Unlike hierarchical model, this model allows each record to have more than one parent record.
• The Network Database Model to allow multiple records to be linked to the same owner file
creating a many-to-many relationship rather than a one-to-many.
• Represents complex data relationships more effectively than the hierarchical model.
Network Data Model (Cont’d)
• Like hierarchical model, network model is a collection of physically linked records.
• Collection of records in 1:M relationships
• A relationship is called a Set
• Composed of at least two record types
• Owner
• Equivalent to the hierarchical model’s parent
• Member
• Equivalent to the hierarchical model’s child
• A record can appear as a member in more than one set i.e., a member may have
multiple owners
• The data is still stored in files but now we also have to define the set types.
• Relationships are modelled using sets.
• Set types CustommerAccount, AccountTransaction
• The entry points are records that can be searched
Example:

Network Data Model

52
Advantages Network Data Model

• Conceptual simplicity
• Handles more relationship types
• Data access flexibility – no need for a preorder traversal
• Promotes database integrity – must first define the owner and then the member record
• Data independence
• Network Model is able to model complex relationships and represents semantics of add or
delete on the relationships.
• Can handle most situations for modeling using record types and relationship types.
• Language is navigational; uses constructs like FIND, FIND member, FIND owner,
FIND NEXT within set, GET etc. Programmers can do optimal navigation through the
database
• Conformance to standards
Fundamentals Database Systems 40
Disadvantages Network Data Model

• System complexity

• Lack of structural independence: Any change made to the database structures requires the application
programs to be modified before it can access data

• Navigational and procedural nature of processing.

• Database contains a complex array of pointers that thread through a set of records.

• Little scope for automated "query optimization”


Relational Data Model

• Developed by Dr. Edgar Frank Codd in 1970 (famous paper, 'A Relational Model for
Large Shared Data Banks').
• Terminologies originates from the branch of mathematics called set theory and relational
algebra.
• Can define more flexible and complex relationship.
• Viewed as a collection of tables called “Relations” equivalent to collection of record types.
• A set of records with similar attributes called a TABLE
• Relation: Two dimensional table.
• Stores information or data in the form of tables rows and columns.
• A row of the table is called tuple equivalent to record.
• A column of a table is called attribute equivalent to fields.

Fundamentals Database Systems 42


Relational Data Model (Cont’d)
• Data value is the value of the Attribute.
• Records are related by the data stored jointly in the fields of records in two tables or files.
• The related tables contain information that creates the relation.
• No physical consideration of the storage is required by the user.
• Many tables are merged together to come up with a new virtual view of the relationship.
• The relational data model is implemented through a very sophisticated relational database
management system (RDBMS).
Relational Data Model (Cont’d)

• The RDBMS manages all of the physical details, while the user sees the relational database as a collection of
tables in which data are stored.

• Most of the popular commercial DBMS products like Oracle ,Sybase, Mysql are based on relational data model

• The user can manipulate and query the data in a way that seems intuitive and logical.

• The rows represent records (collections of information about separate items).

• The columns represent fields (particular attributes of a record).

• Conducts searches by using data in specified columns of one table to find additional data in another table.

• In conducting searches, a relational database model matches information from a field in one table with
information in a corresponding field of another table to produce a third table that combines requested data from
both tables.

Fundamentals Database Systems 44


Relational Data Model (Cont’d)
Advantages of Relational Data Model

• Structural independence – changes in the relational data structure do not affect the
DBMS’s data access in any way
• Relational data model supports relational algebra and also relational operations of the set
theory like union, intersection and etc
• Improved conceptual simplicity by concentrating on the logical view
• Easier database design, implementation, management, and use
• Dynamic views: in RDBMS, a view is not a part of physical schema, it always dynamic
• Structured Query Language: For data access in RDBMS, we have query language
SQL.Most of the database vendors support SQL standards
• Ad hoc query capability - SQL
• Powerful database management system
• Excellent data security: Relational database supports the concept of user rights, every user
is assigned with some database permission called user rights
Disadvantages Relational Data Model
• Substantial hardware and system software overhead
• Can facilitate poor design and implementation
Fundamentals Database Systems 46
Object-Oriented Model:

• Models both data and their relationships in a single structure known as an object
• Uses objects and classes to represent data and relationships.
• Object oriented data model (OODM) is the basis for object-oriented database
management system(OODMS)
• Inheritance and Polymorphism
• Inheritance is the ability of an object within a class hierarchy to inherit the attributes
and methods of classes above it.
• OODM supports inheritance and polymorphism, which can simplify data modeling
and code reuse.

• Complex Data Types: Can handle complex data types, such as images and audio.

• Example: ObjectDB, Versant.


Example of OODM
Object relational

• An object relational model is a combination of a Object oriented database model and a


Relational database model.

• So, it supports objects, classes, inheritance etc. just like Object Oriented models and has
support for data types, tabular structures etc. like Relational data model.

• One of the major goals of Object relational data model is to close the gap between relational
databases and the object oriented practises frequently used in many programming languages
such as C++, C#, Java etc.
Example of Object relational Data Model
Advantages relational Data Model

Inheritance
• The Object Relational data model allows its users to inherit objects, tables etc. so
that they can extend their functionality. Inherited objects contains new attributes as
well as the attributes that were inherited.
Complex Data Types
• Complex data types can be formed using existing data types. This is useful in
Object relational data model as complex data types allow better manipulation of
the data.
Extensibility
• The functionality of the system can be extended in Object relational data model.
This can be achieved using complex data types as well as advanced concepts of
object oriented model such as inheritance.
Disadvantages Relational Data Model

The object relational data model can get quite complicated and difficult to handle
at times as it is a combination of the Object oriented data model and Relational
data model and utilizes the functionalities of both of them.
Database Languages and Interfaces

DBMS Languages
• A DBMS has appropriate languages and interfaces to express database queries and
updates.
• Database languages can be used to read, store and update the data in the database.
Data Definition Language

• DDL stands for Data Definition Language. It is used to define database structure or
pattern.
• It is used to create schema, tables, indexes, constraints, etc. in the database.
• Using the DDL statements, you can create the skeleton of the database.
• Data definition language is used to store the information of metadata like the number
of tables and schemas, their names, indexes, columns in each table, constraints, etc.
Here are some tasks that come under DDL

• Create: It is used to create objects in the database.


• Alter: It is used to alter the structure of the database.
• Drop: It is used to delete objects from the database.
• Truncate: It is used to remove all records from a table.
• Rename: It is used to rename an object.
• These commands are used to update the database schema that's why they come under Data
definition language
Data Manipulation Language
• DML stands for Data Manipulation Language. It is used for accessing
and manipulating data in a database. It handles user requests.

Here are some tasks that come under DML


Select: It is used to retrieve data from a database.
Insert: It is used to insert data into a table.
Update: It is used to update existing data within a table.
Delete: It is used to delete records from a table.
Merge: It performs UPSERT operation, i.e., insert or update operations.
Data Control Language(DCL)

• Are used to control privileges in the database.


• The privileges (right to access the data) are required for performing all the
database operations, like creating tables, views, or sequences. DCL statements are
used to perform the work related to the rights, permissions, and other control of
the database system.

Here are some tasks that come under DCL


• Grant: It is used to give user access privileges to a database.
• Revoke: It is used to take back permissions from the user.
Transaction Control Language(TCL)

• The TCL (Transaction Control Language) commands help users manage and
control a database’s transactions (changes) to maintain consistency.

• Transactions are a set of one or more operations that are executed as a single unit of
work. Either all or none of the operations should be completed.

Here are some tasks that come under TCL

• Commit: It is used to save the transaction on the database.


• Rollback: It is used to restore the database to original since the last Commit.
Interfaces in DBMS

• A database management system (DBMS) interface is a user interface which


allows for the ability to input queries to a database

• The user and the database are connected through DBMS interfaces

• They give users an easy-to-use interface so they may access and change the data
that is stored in the database. There are several DBMS interface types, each
created to meet certain user requirements.
Command-Line Interface (CLI)

• The earliest and most fundamental form of DBMS interface is the command-line interface
(CLI). Through the use of a command prompt, users may communicate with the database
by inputting commands. Users can only access and modify the database using particular
commands and syntax. Today, programmers and database administrators are the main users
of CLI.
User-Friendly DBMS Interfaces

Menu-Based Interface: These interfaces present the user with lists of


options (called menus) through which the user is able to send the request.

Forms-Based Interface:
• A forms-based interface displays a form to each user.
• Users can complete pre-made forms that provide fields for particular categories of
information, such as name, address, and phone number.
• This type of forms are usually designed or created and programmed for the users that
have no expertise in operating system.
Graphical User Interface(GUI)
• A graphical user interface (GUI) shows the diagrammatic structure.
• GUI’s utilize both menus and forms.

• Most GUIs use a pointing device such as a mouse, to pick a certain part of the
displayed schema diagram.
Natural language Interfaces
• These interfaces accept requests written in English or some other language and
attempt to understand them.

• The system will convert user inquiries into SQL instructions and carry them out if
they are entered in plain English. Users who are unfamiliar with SQL commands
might benefit from using natural language interfaces.
Web-Based Interface

• Users can access the database using a browser using the web-based interface. Users can use
online forms, buttons, and other graphical components to interact with the database using a
web browser. Because they can be accessed from any location with an internet connection,
web-based interfaces are common.
The 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, and

• data
• Hardware:
• Identifies all the physical devices
• Computer is the main and most easily identified hardware component of the database
environment
• Servers (for hosting the database software).
• Storage devices (hard drives, solid-state drives, cloud storage).
• Network infrastructure (routers, switches) to allow access to the database.
• Client machines (desktops, laptops, mobile devices) for users to interact with the database.
• Hardware choices depend on factors like the size of the database, the number of users, and
performance requirements.

• Software:
• Refers to the collection of programs used by the computers within the database system
• Three (3) types of system software:
• Operating system
• DBMS software
• Application program and utilities
• Operating System:
• Manages all hardware components and makes it possible for all other software to run
on the computer
• A Software on which the DBMS runs.

• Eg:
• Windows Server, Linux
• Database Management System (DMBS)
• Manages the database within the system
• The DBMS provides features like data storage, retrieval, security, concurrency
control, and backup/recovery.
• Some examples of DBMS include: Microsoft’s Access and SQL Server, Oracle,
MySQL, PostgreSQL, MongoDB)
• Application Programs:
• Software applications that interact with the database (e.g., a web application, a
reporting tool).
• Database Tools: Utilities for tasks like database design, administration, data
migration, and performance monitoring.
People (Users):

The people who interact with the database system in various roles.

Key roles:
• Database Administrators (DBAs): Responsible for the overall management of the
database system, including installation, configuration, security, performance tuning, backup,
and recovery.
• Database Designers: Design the database schema (tables, relationships, constraints) to
meet the organization's data requirements.
• Application Developers: Develop the applications that access and use the data stored in the
database.
• End Users: The individuals who use the applications to access and manipulate the data
• Data Analysts/Scientists: Analyze the data to extract insights and support decision-
making.
Procedures:

• The documented rules, guidelines, and processes for managing and using the database.

Examples:

 Data security policies (authentication, authorization, encryption).


 Backup and recovery procedures.
 Change management procedures.
 Disaster recovery plans.
 Data quality control procedures.
 Data governance policies.
DBMS Component Modules

Fundamentals Database Systems 73


DBMS Component Modules

• A DBMS is a complex software system. There are different types of software


components that constitute a DBMS .

Fundamentals Database Systems 74


DBMS Component Modules
Query Processor
• The query processor is an important component of a DBMS. It interprets user queries and
executes them precisely. The query process involves several specialized components that
handle different tasks to convert high-level queries into low-level instructions.

1. The DDL compiler


• Processes schema definitions, specified in the DDL, and Stores descriptions of the schemas
(meta-data) in the DBMS catalog. The catalog includes information such as the names of
files, data items, storage details of each file, mapping information among schemas, and
constraints . It handles statements like CREATE, ALTER, and DROP.
Fundamentals Database Systems 75
DBMS Component Modules

Query Processor…
2. DML Compiler: The Data Manipulation Language (DML) compiler processes user
commands like SELECT, INSERT, UPDATE, and DELETE. It converts these high-level
queries into low-level instructions that the DBMS can understand and execute

3. Embedded DML Pre-compiler: integrates DML statements into programming


languages like C, Java, or Python. It translates embedded SQL queries into a format that
the DBMS can process. It is necessary to maintain proper communication between
applications and the database.
Fundamentals Database Systems 76
DBMS Component Modules

Query Processor…
4. Query Optimizer
• For any given query, there may be a number of different ways to execute it
• Each operation in the query (SELECT, JOIN, etc.) can be implemented using one or more different Access
Routines.
• For example, an access routine that employs an index to retrieve some rows would be more efficient that an access
routine that performs a full table scan.
• The goal of the query optimizer is to find a reasonably efficient strategy for executing the query using the access
routines.
• Query optimizer is concerned with the
• rearrangement and possible reordering of operations,
• elimination of redundancies, and
• use of correct algorithms and indexes during execution.
• consults the system catalog
• Generates executable code that performs the necessary operations for the query and makes calls on the runtime processor.
Fundamentals Database Systems 77
DBMS Component Modules (Cont’d)
The runtime database processor :
• It handles database accesses at run time.
• It receives retrieval or update operations and carries them out on the database
• It involves:
1. Data Files: Data files hold the actual user data in a structured format. These files store
all the records, transactions, and information required by the application. They are
designed for optimized storage and fast retrieval.
2. Data Dictionary: The data dictionary is also known as metadata storage and contains
detailed information about the database structure. It records table names, column types,
constraints, and relationships. This acts as a reference for the DBMS so it can
understand how data is organized and used.
3. Indices: Indices are like shortcuts for data access. They create pointers for specific
rows or records, which enables the DBMS to locate data quickly without scanning the
entire database. Indices are necessary to greatly improve query performance and are
especially needed for large datasets.
Fundamentals Database Systems 78
DBMS Component Modules (Cont’d)

Concurrency control:
• Concurrency control enables multiple users to access a database at the same
time without causing errors or data issues. It prevents problems like data
loss, inconsistencies, or system crashes by managing how transactions are
handled. A transaction, which is a single logical unit of work that retrieves
or modifies data can cause delays if executed one at a time. This increases
the waiting time for other transactions and slows overall performance. To
improve throughput and reduce delays, transactions are executed
concurrently. It allows the database to handle multiple tasks efficiently.

Fundamentals Database Systems 79


DBMS Component Modules (Cont’d)

Storage Manager
• The storage manager is an essential part of a database management system. It
handles how data is stored, retrieved, and managed on physical storage devices
like disks. The storage manager is responsible for data integrity, security, and
efficient access. It includes the following key components:
• Authorization Manager: It’s a check that only lets authorized users access or modify the
database. It verifies user credentials and permissions to prevent unauthorized access, so the
database is secure.
• Integrity Manager: The integrity manager enforces rules that maintain the correctness of
the data. For example, it ensures no duplicate primary keys exist and that foreign key
constraints are followed. This prevents invalid or inconsistent data from entering the
database.

3/10/2025 80
DBMS Component Modules (Cont’d)

Storage Manager…

• Transaction Manager: oversees all database transactions. It oversees that each


transaction is completed fully or not at all which is needed for maintaining the
database's reliability. This includes handling operations like rollbacks in case of
failures and maintaining data

• File Manager: The file manager organizes and manages data on physical storage
devices. It handles how data files are created, read, and written. This component is
necessary for efficient storage utilization and supports large-scale data management.
• Buffer Manager: The buffer manager controls the flow of data between main
memory (RAM) and disk storage. It stores frequently accessed data temporarily in
memory to speed up data retrieval and reduce disk access time.
3/10/2025 81
Database System Utilities

• In addition to possessing the software modules just described, most DBMSs have
database utilities that help the DBA in managing the database system. Common utilities
have the following types of functions:

• Loading: A loading utility is used to load existing data files—such as text files or
sequential files—into the database without writing programs.

• Backup: A backup utility creates a backup copy of the database, usually by dumping
the entire database onto tape or other mass storage medium.
• Database storage reorganization: used to reorganize a set of database files into
different file organizations, and create new access paths to improve performance.
• Performance monitoring: Such a utility monitors database usage and provides
statistics to the DBA.
Fundamentals Database Systems 82
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture


• Tier architecture refers to the way a database system is structured.

• This structure is defined by how its components are distributed across different layers

• In tier architecture, the database is divided into multiple layers, such as single-tier, two-
tier, or three-tier systems

• These tiers create separation of the user interface, application logic, and database to i

• Improve scalability, security, and maintenance

• In an n-tier DBMS architecture, the system is divided into n independent layers

3/10/2025 83
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture …


• 1-tier architecture in DBMS has a single layer where the database and user interface coexist.
• Two-tier DBMS architecture separates the system into two layers, typically a client and a
server.
• Three-tier architecture introduces a middle layer, such as an application server, for additional
processing.

• As the number of layers increases, the level of abstraction also increases, enhancing security and
adding complexity to the database system structure. Each layer in the application architecture
in DBMS operates independently. Therefore, modifications to one layer do not affect the others,
ensuring flexibility and maintainability in the system design.

3/10/2025 84
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture …


Single Tier Architecture in DBMS

• In single-tier architecture in DBMS, the database is directly accessible to the user. The user
interacts with the DBMS architecture directly, making changes that immediately reflect on the
database. This architecture does not offer user-friendly tools for end-users and is ideal for local
application development where programmers need quick, direct access to the database.
• This type of architecture of a database system is best suited for scenarios where:
• Data is rarely modified.
• Only a single user is accessing the database.
• A straightforward way to interact with or modify the database is required.
• This type of system is generally referred as local database system
85
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture …


Two Tier Architecture in DBMS

• In two-tier architecture, the system follows a basic client-server architecture.

• Client-side applications directly communicate with the server-side database using APIs
like ODBC (Open Database Connectivity) or JDBC (Java Database Connectivity).

• The user interface and application logic run on the client side, while the server handles
tasks like query processing and transaction management. In this DBMS architecture, the
client application establishes a connection to the server to interact with the database.

3/10/2025 86
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture …


Two Tier Architecture in DBMS

• In two-tier architecture, the system follows a basic client-server architecture.

• Client-side applications directly communicate with the server-side database using APIs
like ODBC (Open Database Connectivity) or JDBC (Java Database Connectivity).

• The user interface and application logic run on the client side, while the server handles
tasks like query processing and transaction management. In this DBMS architecture, the
client application establishes a connection to the server to interact with the database.

3/10/2025 87
Two Tier Architecture in DBMS …
Example:
Imagine withdrawing cash at a bank. The banker enters your account details and
withdrawal amount into the system. The client application (banker’s interface) sends a
request to the server-side database to check your balance and process the transaction.

Advantages of Two-Tier Architecture:

1. Supports Multiple Users: Suitable for organisations as multiple users can access
the database simultaneously.
2. High Processing Power: The server handles database functions, improving
performance.
3. Faster Access: Direct connection between client and server ensures quick data
retrieval.
4. Easy Maintenance: With two distinct layers, updates and maintenance become
simpler
Centralized and Client/Server Architectures for DBMSs

Types of Tier DBMS Architecture …


Three Tier Architecture in DBMS

• In a three-tier architecture, there is an additional layer between the client and the server,
known as the application server.

• The client does not directly communicate with the database. Instead, client-side
applications interact with the application server, which then communicates with the
database server. This layer of separation ensures that the end-user is unaware of the
database's internal details, and the database remains insulated from direct client
interactions.
3/10/2025 90
Three Tier Architecture in DBMS…
Working of Application Layer

• The application layer acts as an intermediary between the client and the database. It
processes requests from the client, then performs necessary business logic, and finally
sends the appropriate queries to the database. This separation keeps the client only
with the application layer, and hence, it keeps the database secure and independent
from direct user interactions.
Example:
Consider an online shopping platform like Amazon. When a user places an order, the client-
side interface (website or app) sends the request to an application server. The application
server processes the order, verifies stock availability, and updates the database accordingly.
The client never communicates directly with the database; the application server handles all
interactions.

Advantages of Three-Tier Architecture:

1. Scalability: The application server can manage load balancing, allowing support for
numerous clients without impacting database performance.
2. Data Integrity: The application layer filters and validates client requests, reducing the
risk of data corruption or erroneous queries.
3. Security: By removing direct access to the database, the architecture minimizes the
chance of unauthorized access and enhances security.
Centralized and Client/Server Architectures for DBMSs
1. Centralized and Client-Server Architectures:
 Centralized DBMS: combines everything into single system including- DBMS software,
hardware, application programs and user interface processing software.
 User can still connect through a remote terminal – however, all processing is done at
centralized site.
 The primary processing for all system functions, including user application programs, user
interface programs, and all DBMS capabilities are handled by server
 Users access such systems using computer terminals with limited processing power and
merely display capabilities.
 Only display data and controls were delivered from the computer system to the display
terminals, which were connected to the central node by a variety of communications
networks, while all processing was done remotely on the computer system.
 It includes the following three things:
A, Specialized Servers with Specialized functions:
 File Servers
 Printer Servers
 Web Servers
 E-mail Servers
3/10/2025 94
Database System Architecture (Cont’d)

Centralized and Client-Server Architectures …


It includes the following three things:
B. Clients:
 Provide appropriate interfaces and a client-version of the system to access and utilize the server
resources.
 Clients maybe diskless machines or PCs or Workstations with disks with only the client software
installed.
 Connected to the servers via some form of a network. (LAN: local area network, wireless network,
etc.)
C. DBMS Server:
 Provides database query and transaction services to the clients.
 Sometimes called query and transaction servers.

3/10/2025 95
Database System Architecture

2. Two Tier Client-Server Architecture:


 User Interface Programs and Application Programs for local processing run on the client
side.
 When a client needs access to extra features-like database access-that are not available on that
system, it connects to a server that offers those features
 Interface called ODBC (Open Database Connectivity) provides an Application program
interface (API) allow client side programs to call the DBMS.
 A client program may connect to several DBMSs.

3/10/2025 97
Database System Architecture
3. Three Tier Client-Server Architecture:
 Common for Web applications.
 Intermediate Layer called Application Server or Web Server:
 Stores the web connectivity software and the rules and business logic
(constraints) part of the application used to access the right amount of data
from the database server
 Acts like a conduit for sending partially processed data between the database
server and the client.

 Additional Features- Security:


 Encrypt the data at the server before transmission.
 Decrypt data at the client.

3/10/2025 98
Database System Architecture

Three Tier Client-Server Architecture…

3/10/2025 99
Classification of Database Management Systems
• The first criterion to categorize DBMSs is based on the data model:
• Relational, object, object-relational, hierarchical, network, and other.
• The second criterion used to classify DBMSs is the number of users supported by the
system.
• Single-user systems support only one user at a time and are mostly used with PCs.
• Multiuser systems, which include the majority of DBMSs, support concurrent
multiple users.
• The third criterion is the number of sites over which the database is distributed.
• A DBMS is centralized if the data is stored at a single computer site.
o A centralized DBMS can support multiple users, but the DBMS and the database reside totally
at a single computer site.
• A distributed DBMS (DDBMS) can have the actual database and DBMS software
distributed over many sites, connected by a computer network.
• Distributed DBMS can be
• Homogeneous : DDBMSs use the same DBMS software at all the sites,
• Heterogeneous: DDBMSs can use different DBMS software at each site.
Fundamentals Database Systems 100
Classification of Database Management Systems (Cont’d)

• Other criteria is :
• Based on cost
• Free (open-source) DBMS
Eg. PostgreSQL and MySQL
• Licensed
• Based on purpose of the DB
• General purpose
• Special purpose eg. Online transaction processing (OLTP) systems,

Fundamentals Database Systems 101

You might also like