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

Dbms UNIT 1

This document provides an overview of database systems and compares them to file systems. It discusses the advantages of using a database management system (DBMS) over a file system, including data independence, efficient data storage and retrieval, data integrity and security, and reduced application development time. The document also describes the architecture of a DBMS including three levels - external, conceptual, and internal - and defines logical and physical data independence.

Uploaded by

chowdary 123
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Dbms UNIT 1

This document provides an overview of database systems and compares them to file systems. It discusses the advantages of using a database management system (DBMS) over a file system, including data independence, efficient data storage and retrieval, data integrity and security, and reduced application development time. The document also describes the architecture of a DBMS including three levels - external, conceptual, and internal - and defines logical and physical data independence.

Uploaded by

chowdary 123
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

UNIT-I: An Overview of Database Systems: Managing Data, File

Systems verses DBMS, Advantages of DBMS, Data Independence.


Database System Architecture: Three Levels of Architecture, External
Level, Conceptual Level, Internal Level, Structure of DBMS, The Database
Management Systems and Client/Server Architecture.

Data: Data is a collection of facts, such as numbers, words,


measurements, observations or just descriptions of things.
Database: The database is a collection of inter-related data which is
used to retrieve, insert and delete the data efficiently. It is also used to
organize the data in the form of a table, schema, views, and reports, etc.
For example: The college Database organizes the data about the admin,
staff, students and faculty etc
Database management system is software which is used to manage the
database.
Managing Data
• Data Definition: It is used for creation, modification, and removal of
definition that defines the organization of data in the database.
• Data Updation: It is used for the insertion, modification, and
deletion of the actual data in the database.
• Data Retrieval: It is used to retrieve the data from the database
which can be used by applications for various purposes.
• User Administration: It is used for registering and monitoring users,
maintain data integrity, enforcing data security, dealing with
concurrency control, monitoring performance and recovering
information corrupted by unexpected failure.
File system: A file system is a technique of arranging the files in a storage
medium like a hard disk, pen drive, DVD, etc. It helps you to organizes the
data and allows easy retrieval of files when they are required. It mostly
consists of different types of files like mp3, mp4, txt, doc, etc. A file
system enables you to handle the way of reading and writing data to the
storage medium.
Features of a File system
• It helps you to store data in a group of files.
• Files data are dependent on each other.
• C/C++ and COBOL languages were used to design the files.
• Shared File System Support
• Fast File System Recovery
Advantages of File system
• Enforcement of development and maintenance standards.
• Helps you to reduce redundancy
• Avoid inconsistency across file maintenance to get the integrity of
data independence.
• Firm theoretical foundation (for the relational model).
• It is more efficient and cost less than a DBMS in certain situations.
• The design of file processing is simpler than designing Database.
Disadvantages of File system
• Each application has its data file so, the same data may have to be
recorded and stored many times.
• Data dependence in the file processing system are data-dependent,
but, the problem is incompatible with file format.
• Limited data sharing.
• The problem with security.
• Time-consuming.
• It allows you to maintain the record of the big firm having a large
number of items.
• Required lots of labor work to do.
Features of DBMS
• A user-accessible catalog of data
• Transaction support
• Concurrency control with Recovery services
• Authorization services
• The value of data is the same at all places.
• Offers support for data communication
• Independent utility services
• Allows multiple users to share a file at the same time
Advantages of DBMS system
• DBMS offers a variety of techniques to store & retrieve data
• Uniform administration procedures for data
• Application programmers never exposed to details of data
representation and Storage.
• A DBMS uses various powerful functions to store and retrieve data
efficiently.
• Offers Data Integrity and Security
• The DBMS implies integrity constraints to get a high level of
protection against prohibited access to data.
• Reduced Application Development Time
• Consume lesser space
• Reduction of redundancy.
• Data independence.
Disadvantages of the DBMS system
• Cost of Hardware and Software of a DBMS is quite high, which
increases the budget of your organization.
• Most database management systems are often complex systems, so
the training for users to use the DBMS is required.
• The use of the same program at a time by many users sometimes
lead to the loss of some data.
• DBMS can't perform sophisticated calculations
• Data-sets begins to grow large as it provides a more predictable
query response time.
• It required a processor with the high speed of data processing.
• The database can fail because or power failure or the whole system
stops.
• The cost of DBMS is depended on the environment, function, or
recurrent annual maintenance cost.

Difference between file system vs DBMS


File System DBMS
A file system is a software that DBMS or Database Management
manages and organizes the files in a System is a software application. It is
storage medium. It controls how data is used for accessing, creating, and
stored and retrieved. managing databases.
The file system provides the details of DBMS gives an abstract view of data
data representation and storage of that hides the details
data.
Storing and retrieving of data can't be DBMS is efficient to use as there are a
done efficiently in a file system. wide variety of methods to store and
retrieve data.
It does not offer data recovery There is a backup recovery for data in
processes. DBMS.
The file system doesn't have a crash DBMS provides a crash recovery
recovery mechanism. mechanism
Protecting a file system is very difficult. DBMS offers good protection
mechanism.
In a file management system, the The redundancy of data is low in the
redundancy of data is greater. DBMS system.
Data inconsistency is higher in the file Data inconsistency is low in a database
system. management system.
The file system offers lesser security. Database Management System offers
high security.
File System allows you to stores the Database Management System stores
data as isolated data files and entities. data as well as defined constraints and
interrelation.
Not provide support for complicated Easy to implement complicated
transactions. transactions.
The centralization process is hard in Centralization is easy to achieve in the
File Management System. DBMS system.
It doesn't offer backup and recovery of DBMS system provides backup and
data if it is lost. recovery of data even if it is lost.
There is no efficient query processing in You can easily query data in a database
the file system. using the SQL language.
These system doesn't offer DBMS system provides a concurrency
concurrency. facility.
Application of the DBMS system
• Admission System Examination System Library System
• Payroll & Personnel Management System
• Accounting System Hotel Reservation System Airline Reservation
System
• It is used in the Banking system for Customer information, account
activates, Payments, deposits, loans, etc.
• Use for Airlines for reservations and schedules
• DBMS system also used by universities to keep call records, monthly
bills, maintaining balances, etc.
• Finance for storing information about stock, sales, and purchases of
financial instruments like stocks and bonds.
Data Independence of DBMS
Data Independence is defined as a property of DBMS that helps you to
change the Database schema at one level of a database system without
requiring changing the schema at the next higher level. Data
independence helps you to keep data separated from all programs that
make use of it.
Importance of Data Independence
• Helps you to improve the quality of the data
• Database system maintenance becomes affordable
• Enforcement of standards and improvement in database security
• You don't need to alter data structure in application programs
• Permit developers to focus on the general structure of the Database
rather than worrying about the internal implementation
• It allows you to improve state which is undamaged or undivided
• Database incongruity is vastly reduced.
• Easily make modifications in the physical level is needed to improve
the performance of the system.
Types of Data Independence
In DBMS there are two types of data independence
1. Physical data independence.
2. Logical data independence.
Difference between Physical and Logical Data Independence
Logica Data Independence Physical Data Independence
Logical Data Independence is mainly Mainly concerned with the storage of
concerned with the structure or the data.
changing the data definition.
It is difficult as the retrieving of data is It is easy to retrieve.
mainly dependent on the logical
structure of data.
Compared to Logic Physical Compared to Logical Independence it is
independence it is difficult to achieve easy to achieve physical data
logical data independence. independence.
You need to make changes in the A change in the physical level usually
Application program if new fields are does not need change at the
added or deleted from the database. Application program level.
Modification at the logical levels is Modifications made at the internal
significant whenever the logical levels may or may not be needed to
structures of the database are changed. improve the performance of the
structure.
Concerned with conceptual schema Concerned with internal schema
Example: Add/Modify/Delete a new Example: change in compression
attribute techniques, hashing algorithms, storage
devices, etc

Levels of Database
The database has 3 levels as shown in the diagram below
1.Physical/Internal
2.Conceptual
3.External
Consider an Example of a University Database. At the different levels this
is how the implementation will look like:
Type of Schema Implementation

External Schema View1:Course info(cid:int,cname:string)


View 2: student info(id:int. name:string)

Conceptual Shema Students(id: int, name: string, login: string, age: integer)
Courses(id: int, cname.string, credits:integer)
Enrolled(id: int, grade:string)

Physical Schema • Relations stored as unordered files.


• Index on the first column of Students.
Database management systems architecture
Database management systems architecture will help us 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. We will understand this communication with the help of
diagrams.
Types of DBMS Architecture
There are three types of DBMS architecture:
1. Single tier architecture
2. Two tier architecture
3. Three tier architecture
Single tier architecture
In this type of architecture, the database is readily available on the client
machine, any request made by client doesn’t require a network
connection to perform the action on the database.
For example, lets say you want to fetch the records of employee from the
database and the database is available on your computer system, so the
request to fetch employee details will be done by your computer and the
records will be fetched from the database by your computer as well. This
type of system is generally referred as local database system
Two tier architecture
In two-tier architecture, the Database system is
present at the server machine and the DBMS
application is present at the client machine,
these two machines are connected with each
other through a reliable network as shown in the
above diagram.
Whenever client machine makes a request to
access the database present at server using a
query language like sql, the server perform the
request on the database and returns the result
back to the client. The application connection
interface such as JDBC, ODBC are used for the interaction between server
and client.
Three tier architecture
In three-tier architecture, another layer is present
between the client machine and server machine. In
this architecture, the client application doesn’t
communicate directly with the database systems
present at the server machine, rather the client
application communicates with server application
and the server application internally communicates
with the database system present at the server.
Structure of DBMS
These are the components responsible of maintaining
The structure of DBMS :-
1) APPLICATION
2) END USER
3) DDL
4) DDL COMPILER
5) DML COMPILER
6) QUERY OPTIMIZER
7) DATA FILES
8) DATA DICTIONARY
9) DATA MANAGER
Applications
it can be considered as a user friendly web page where the user enters the
requests. Here he simply enters the details that he needs and presses
buttons to get the data.
End User
They are the real users of the database. They can be developers,
designers, administrator or the actual users of the database.
DDL Data Definition Language (DDL)
is a query fired to create database, schema, tables, mappings etc in the
database. These are the commands used to create the objects like tables,
indexes in the database for the first time. In other words, they create
structure of the database.
DDL Compiler
This part of database is responsible for processing the DDL commands.
That means these compiler actually breaks down the command into
machine understandable codes. It is also responsible for storing the
metadata information like table name, space used by it, number of
columns in it, mapping information etc.
DML Compiler
When the user inserts, deletes, updates or retrieves the record from the
database, he will be sending request which he understands by pressing
some buttons. But for the database to work/understand the request, it
should be broken down to object code. This is done by this compiler. One
can imagine this as when a person is asked some question, how this is
broken down into waves to reach the brain.
Query Optimizer
When user fires some request, he is least bothered how it will be fired on
the database. He is not all aware of database or its way of performance.
But whatever be the request, it should be efficient enough to fetch, insert,
update or delete the data from the database. The query optimizer decides
the best way to execute the user request which is received from the DML
compiler. It has the real data stored in it. It can be stored as magnetic
tapes, magnetic disks or optical disks.
Data Files
It contains all the information about the database. As the name suggests,
it is the dictionary of all the data items.
Data Dictionary
It contains description of all the tables, view, materialized views,
constraints, indexes, triggers etc

The Database Management Systems and Client/Server


Architecture.
Centralized Systems
Run on a single computer system and do not interact with other computer
systems.
General-purpose computer system: one to a few CPUs and a number of
device controllers that are connected through a common bus that
provides access to shared memory.
Single-user system (e.g., personal computer or workstation): desk-top
unit, single user, usually has only one CPU and one or two hard disks; the
OS may support only one user.
Multi-user system: more disks, more memory, multiple CPUs, and a multi-
user OS. Serve a large number of users who are connected to the system
vie terminals. Often called server systems.
• Client-Server Systems

Server systems satisfy requests generated at m client systems, whose


general structure is shown below:
• Database functionality can be divided into:
Back-end: manages access structures, query evaluation and
optimization, concurrency control and recovery.
Front-end: consists of tools such as forms, report-writers, and
graphical user interface facilities.
• The interface between the front-end and the back-end is through
SQL or through an application program interface.

Advantages of replacing mainframes with networks of workstations or


personal computers connected to back-end server machines:
• better functionality for the cost
• flexibility in locating resources and expanding facilities
• better user interfaces
• easier maintenance
Server System Architecture
• Server systems can be broadly categorized into two kinds:
• transaction servers which are widely used in relational
database systems, and
• data servers, used in object-oriented database systems
Transaction Servers
• Also called query server systems or SQL server systems
• Clients send requests to the server
• Transactions are executed at the server
• Results are shipped back to the client.
• Requests are specified in SQL, and communicated to the server
through a remote procedure call (RPC) mechanism.
• Transactional RPC allows many RPC calls to form a transaction.
• Open Database Connectivity (ODBC) is a C language application
program interface standard from Microsoft for connecting to a
server, sending SQL requests, and receiving results.
• JDBC standard is similar to ODBC, for Java
Transaction Server Process Structure
• A typical transaction server consists of multiple processes accessing
data in shared memory.
• Server processes
• These receive user queries (transactions), execute them and
send results back
• Processes may be multithreaded, allowing a single process to
execute several user queries concurrently
• Typically multiple multithreaded server processes
• Lock manager process
• More on this later
• Database writer process
• Output modified buffer blocks to disks continually
• Log writer process
• Server processes simply add log records to log record buffer
• Log writer process outputs log records to stable storage.
• Checkpoint process
• Performs periodic checkpoints
• Process monitor process
• Monitors other processes, and takes recovery actions if any
of the other processes fail
• E.g. aborting any transactions being executed by a
server process and restarting it
Data Servers
• Used in high-speed LANs, in cases where
• The clients are comparable in processing power to the server
• The tasks to be executed are compute intensive.
• Data are shipped to clients where processing is performed, and
then shipped results back to the server.
• This architecture requires full back-end functionality at the clients.
• Used in many object-oriented database systems
• Issues:
• Page-Shipping versus Item-Shipping
• Locking
• Data Caching
• Lock Caching
• Page-shipping versus item-shipping
• Smaller unit of shipping Þ more messages
• Worth prefetching related items along with requested item
• Page shipping can be thought of as a form of prefetching
• Locking
• Overhead of requesting and getting locks from server is high
due to message delays
• Can grant locks on requested and prefetched items; with
page shipping, transaction is granted lock on whole page.
• Locks on a prefetched item can be P{called back} by the
server, and returned by client transaction if the prefetched
item has not been used.
• Locks on the page can be deescalated to locks on items in the
page when there are lock conflicts. Locks on unused items
can then be returned to server.
• Data Caching
• Data can be cached at client even in between transactions
• But check that data is up-to-date before it is used (cache
coherency)
• Check can be done when requesting lock on data item
• Lock Caching
• Locks can be retained by client system even in between
transactions
• Transactions can acquire cached locks locally, without
contacting server
• Server calls back locks from clients when it receives
conflicting lock request. Client returns lock once no local
transaction is using it.
• Similar to de-escalation, but across transactions.

You might also like