CH - 1 Dbms CLG
CH - 1 Dbms CLG
Database :
A database is a structured collection of data designed to meet the data management
needs of an organization. These are used to store, manage, and retrieve the
information.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 1
Management of data involves :
to define structures for storage of information
to provide mechanisms for the manipulation of information
to ensure the safety of the information stored, despite system crashes or
attempts at unauthorized access. If data are to be shared among several
users, the system must avoid possible anomalous results
Thus DBMS allows users to create, modify and query databases while ensuring
data integrity, security and efficient data access.
Key Functions of a DBMS :
Data Storage and Retrieval : DBMS provides the mechanisms for storing and
retrieving data efficiently.
Data Definition : DBMS allows users to define the structure of the database
(schema) using languages like SQL.
Data Manipulation : DBMS provides tools for manipulating data (adding,
updating, deleting).
Data Integrity : DBMS enforces rules and constraints to ensure the accuracy
and consistency of data.
Security : DBMS manages access control and user authentication to protect
data from unauthorized access.
Backup and Recovery : DBMS provides mechanisms for backing up and
restoring data in case of failures.
Concurrency Control : DBMS manages simultaneous access to data by
multiple users.
In essence, a DBMS acts as a bridge between users and data, providing a
structured and controlled environment for data management.
Unlike traditional file systems, It minimizes data redundancy, prevents
inconsistencies and simplifies data management with features like concurrent
access and backup mechanisms.
DBMS plays a vital role in supporting data-driven decision-making and operational
efficiency.
It includes relational databases (like Oracle, MySQL, and PostgreSQL) and
NoSQL databases (like MongoDB, Cassandra).
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 3
Particulars File System DBMS
Data Integrity Lacks built-in mechanisms for Offers features for enforcing
enforcing data consistency and data integrity using constraints
accuracy. and data types.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 4
Particulars File System DBMS
User Access Only one user can access data Multiple users can access data
at a time. at a time.
Meaning The users are not required to The user has to write
write procedures. procedures for managing
databases
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 5
1.3 Levels of Data Abstraction and Data Independence :
A Database System (DBS) is a collection of interrelated data and a set of programs that
allow users to access and modify the data. A major purpose of a database system is to
provide users with an abstract view of the data. Thus the system hides certain details of
how the data are stored and maintained.
View level :
The highest level of abstraction describes only part of the entire database.
Even though the logical level uses simpler structures, complexity remains because of
the variety of information stored in a large database.
Many users of the database system need to access only a part of the database.
The view level of abstraction exists to simplify their interaction with the system.
The system may provide many views for the same database.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 7
An Instance : The collection of information stored in the database at a particular
moment is called an instance. It represents the current state of the database, reflecting
the values of attributes and the content of tables. The data items in a record can be
inserted, modified, or deleted at any time. Thus the data can change from one state to
another.
Example:
dept :
dno dname no_emp
1 HR 3
2 Production 3
emp:
eid ename desig salary dno
1 Mr. Patil supervisor 25000 2
2 Mrs. Sinha asst. mgr 35000 1
3 Mr. Verma accountant 30000 1
4 Mr. Patil mgr 45000 2
5. Mrs. Dixit mgr 42000 1
6 Mrs. Borse store incharge 30000 2
Data Independence
Data independence in a Database Management System (DBMS) is the ability to modify
the database schema (structure) at one level without affecting the schema at another
level. It is achieved through use of the three levels of data abstraction.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 8
Logical Data Independence : It is the ability to change the logical structure (tables,
columns, relationships) without affecting external views or application programs. Purpose
of this to allow the database structure to evolve without impacting user access or
changes in an application code. This is the independence to change the conceptual
schema without having to change the external schemas and their application programs.
Example:
Adding new columns in an existing table/relation.
Creating a new relationship between two tables.
Merging two tables into a view for simplification.
Physical Data Independence : It is the ability to change the physical storage of data
without affecting the logical schema. The purpose is to improve performance, storage
efficiency, or hardware configurations without changing how the data is structured
logically. This is the independence to change the internal schema without having to
change the conceptual schema.
Example:
Moving data files from one drive to another i.e. from drive C: to drive D:.
Creating an index to speed up queries.
Switching from HDD to SSD for better performance.
Compressing data files to save space.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 10
Authorization and Integrity manager : It tests for the satisfaction of integrity
constraints and checks the authority of users to access data.
Transaction manager : It ensures that the database remains in a consistent
(correct) state despite system failures, and that concurrent transaction executions
proceed without conflicting.
File manager : It manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.
Buffer manager : It is responsible for fetching data from disk storage into main
memory, and deciding what data to cache in main memory. The buffer manager
enables the database to handle data of size that are much larger than the size of
main memory.
The storage manager implements several data structures as part of the physical
system implementation:
Data files : which store the database itself.
Data dictionary : which stores metadata (Data about the data) i.e. the structure of
the database and the schema of the database.
Indices : which can provide fast access to data items. A database index provides
pointers to those data items that hold a particular value. Hashing is an alternative
to indexing that is faster in some but not all cases.
Statistical Data : It stores statistical information about the data in the database.
This information used by the query processor to select efficient ways to execute a
query.
DBMS Architecture :
The DBMS architecture refers to the structural design and its interconnected
components that manage and maintain databases efficiently and effectively.
The widely used approach is the client-server architecture. Client and Server
components are separated to streamline data handling, application logic, and user
interactions.
DBMS architecture will help us to understand the components of database system
and the relation among them.
The architecture of DBMS depends on the computer system on which it runs.
For example, in a client-server DBMS architecture, the database systems at server
machine can run several requests made by client machine.
Types of DBMS Architecture
Two Tier Architecture
Three Tier Architecture
Two tier Architecture :
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 13
These layers are designed to separate concerns and improve the overall functionality,
security, and maintainability of the database system.
Presentation Layer (Client Layer) :
This layer is the user interface (UI) that interacts directly with the user. It handles user
input and displays output.
Application Layer (Business Logic Layer) :
This layer contains the business rules and logic of the application. It processes user
requests, interacts with the data layer to retrieve or update data, and sends results back
to the presentation layer.
Data Layer (Database Layer) :
This layer stores and manages the data. It handles data storage, retrieval, update, and
deletion operations. It is responsible for the physical storage and access of the database.
This separation allows for independent development, maintenance, and scalability of
each layer, making it easier to manage and adapt the system to changing needs.
Naive users : These are the unsophisticated users who interact with the system by
invoking one of the application programs that have been written previously. The typical
user interface for naive users is a forms interface, where the user can fill in appropriate
fields of the form. Naive users may also simply read reports generated from the DB.
Application programmers : These are the computer professionals who write application
programs. Application programmers can choose from many tools to develop user
interfaces. Rapid Application Development (RAD) tools are tools that enable an
application programmer to construct forms and reports with minimal programming effort.
Sophisticated users : These interact with the system without writing programs. Instead,
they form their requests either using a database query language or by using tools such
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 14
as data analysis software. Analysts who submit queries to explore data in the database
fall in this category.
Specialized users : These are sophisticated users who write specialized database
applications that do not fit into the traditional data-processing framework. Among these
applications are computer-aided design systems, knowledgebase and expert systems,
systems that store data with complex data types (for example, graphics data and audio
data), and environment-modeling systems.
Disadvantages of DBMS
A DBMS is a complex piece of software, optimized for certain kinds of workloads and
its performance may not be adequate for certain specialized applications.
Example : Applications with tight real-time constraints or just a few well-defined
critical operations for which efficient custom code must be written.
When an application may need to manipulate the data in ways not supported by the
query language. In such a situation, DBMS is not useful because the abstract view of
the data presented by the DBMS does not match the application's needs and actually
gets in the way.
Example : Relational database do not support flexible analysis of text data
If specialized performance or data manipulation requirements are central to an
application. The application may not use DBMS, especially when the added benefits
of a DBMS (e.g., flexible querying, security, concurrent access, and crash recovery)
are not required. In most situations calling for large-scale data management,
however, DBMSs have become an indispensable tool.
The disadvantage of the DBMS system is overhead cost. The processing overhead
introduced by the DBMS to implement security, integrity, and sharing of the data
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 16
causes a degradation of the response and throughput times. An additional cost is that
of migration from a traditionally separate application environment to an integrated
one.
Even though centralization reduces duplication, the lack of duplication requires that
the database be adequately backup so that in the case of failure the data can be
recovered.
Backup and recovery operations are complex in a DBMS environment, and this is an
increment in a concurrent multi-user database system. A database system requires a
certain amount of controlled redundancies and duplication to enable access to related
data items.
Complexity : The provision of the functionality that is expected of a good DBMS
makes the DBMS an extremely complex piece of software. Failure to understand the
system can lead to bad design decisions, which can have serious consequences for
an organization.
Size : The complexity and breadth of functionality makes the DBMS an extremely
large piece of software, occupying many megabytes of disk space and requiring
substantial amounts of memory to run efficiently.
Performance : The DBMS file based system is written to be more general, to cater
for many applications rather than just one. The effect is that some applications may
not run as fast as they used to.
Higher impact of a failure : The centralization of resources increases the
vulnerability of the system. Since all users and applications rely on the availability of
the DBMS, the failure of any component can bring operations to a halt.
Cost of DBMS : The cost of DBMS varies significantly, depending on the
environment and functionality provided. There is also the recurrent annual
maintenance cost.
Additional Hardware costs : To achieve the required performance it may be
necessary to purchase a larger machine, perhaps even a machine dedicated to
running the DBMS. The procurement of additional hardware results in further
expenditure.
Cost of Conversion : In some situations, the cost of DBMS and extra hardware may
be insignificant compared with the cost of converting existing applications to run on
the new DBMS and hardware. This cost is one of the main reasons why some
organizations feel tied to their current systems and cannot switch to modern database
technology.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 17
1.7 Applications of DBMS :
Databases are widely used in many applications such as :
Enterprise Information :
Sales : For customer, product, and purchase information.
Accounting : For payments, receipts, account balances, assets and other
accounting information.
Human resources : For information about employees, salaries, payroll taxes,
and benefits, and for generation of paychecks.
Manufacturing : For management of the supply chain and for tracking
production of items in factories, inventories of items in warehouses and stores,
and orders for items.
Online retailers : For sales data noted above plus online order tracking,
generation of recommendation lists, and maintenance of online product
evaluations.
Banking and Finance :
Banking: For customer information, accounts, loans, and banking
transactions.
Credit card transactions: For purchases on credit cards and generation of
monthly statements.
Finance : For storing information about holdings, sales, and purchases of
financial stocks and bonds also for storing real-time market data to enable
online trading by customers and automated trading by the firm.
Universities : For student information, course registrations, and grades
Airlines : For reservations and schedule information. Airlines were among the
first to use databases in a geographically distributed manner.
Telecommunication : For keeping records of calls made, generating monthly
bills, maintaining balances on prepaid calling cards, and storing information
about the communication networks.
ACA, Department of Computer Science, GES’s HPT Arts and RYK Science College, Nashik-05 Page No. 18