DBMS (Part 1)
DBMS (Part 1)
Introduction
Outline
• Introduction
• Characteristics of Database
• Database System Applications
• Comparison of File System with Database Approach
2
Introduction
• A database-management system (DBMS) is a collection of
interrelated data and a set of programs to access those data.
• The collection of data, usually referred to as the database, contains
information relevant to an enterprise.
• DBMS Goal : provide a way to store and retrieve database information
that is both convenient and efficient.
• Database systems are designed to manage large bodies of
information.
• Management of data involves both defining structures for storage of
information and providing mechanisms for the manipulation of
information.
3
Introduction (continued)
• In addition, the database system must 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.
4
Main Characteristics of the Database System
Approach
5
Example of a simplified database catalog
Slide
1- 6
Main Characteristics of the Database System
Approach (contd..)
Slide
1- 8
Main Characteristics of the Database System
Approach (contd..)
Slide
1- 9
Database-System Applications
• 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.
10
Database-System Applications
• 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 instruments such as 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. 11
Database-System Applications
• Telecommunication
• For keeping records of calls, texts, and data usage, generating
monthly bills, maintaining balances on prepaid calling cards, and
storing information about the communication networks.
• Web-based services
• Social-media: For keeping records of users, connections between
users(such as friend/follows information), posts made by users,
rating/like information about posts, etc.
• Online retailers: For keeping records of sales data and orders as
for any retailer, but also for tracking a user’s product views,
search terms, etc., for the purpose of identifying the best items to
recommend to that user. 12
Database-System Applications
• Document databases
• For maintaining collections of new articles, patents, published
research papers, etc.
• Navigation systems
• For maintaining the locations of varies places of interest along
with the exact routes of roads, train systems, buses, etc.
13
Advantages of DBMS over File System
• Controlling redundancy in data storage and in development and
maintenance efforts
• Sharing of data among multiple users
• Restricting unauthorized access to data
• Providing persistent storage for program objects
• Providing Storage Structures (e.g. indexes) for efficient Query
Processing
• Providing backup and recovery services
• Providing multiple interfaces to different classes of users
• Representing complex relationships among data
• Enforcing integrity constraints on the database 14
Comparison of File System with
Database Approach
DBMS
File System
File system is a collection of data. Any DBMS is a collection of data and user is
management with the file system, user not required to write the procedures for
has to write the procedures managing the database.
File system gives the details of DBMS provides an abstract view of data
the data representation and storage of that hides the details.
data.
In File system storing and retrieving of DBMS is efficient to use since there are
data cannot be done efficiently. wide varieties of sophisticated techniques
to store and retrieve the data.
Concurrent access to the data in the file DBMS takes care of concurrent access using
system has many problems like : Reading some form of locking.
the file while deleting some information, 15
updating some information
Comparison of File System with
Database Approach(contd..)
File System DBMS
File system doesn’t provide crash DBMS has crash recovery mechanism,
recovery. DBMS protects user from the effects of
Eg. While we are entering some data system failures.
into the file if system crashes then
content of the file is lost
16
Module 1.2
Outline
• Data Abstraction
• Data Independence
• Database Administrator
• DBMS Languages
• Database Users
Data Abstraction
• Data Abstraction refers to the process of hiding data organization
and storage details from the user.
• Database systems are made-up of complex data structures.
• To ease the user interaction with database, the developers hide
internal irrelevant details from users.
• This process of hiding irrelevant details from user is called data
abstraction.
19
Levels of Abstraction
• These three levels of data abstraction / DBMS Three Level
Architecture Diagram:
1. View Level/ External level
2. Conceptual Level/ Logical level
3. Physical Level/ internal level
20
1. Physical Level or Internal Level
• This is the lowest level of data
abstraction.
• It tells us how the data is actually
stored in physical memory (hard disks,
magnetic tapes etc).
• The access methods like sequential or
random access and file organization
methods like B+ trees, hashing used for
the organization purpose
• Developers would know usability, size of
memory, and accessing frequency which
makes easy to design this level.
• Blocks of storage and the amount of
memory used for these purposes is kept 21
hidden from the user.
2. Conceptual or Logical Level
• The conceptual level describes the structure of
the whole database.
For example :
• Consider two users A & B. Both are selecting the fields
"EmployeeNumber" and "EmployeeName".
• If user B adds a new column (e.g. salary) to his table, it will not affect
the external view for user A, though the internal schema of the
database has been changed for both users A & B.
• Logical data independence is more difficult to achieve than physical
data independence, since application programs are heavily
dependent on the logical structure of the data that they access.
28
DBMS System Architecture
30
DBMS System Architecture (continued)
1. Presentation layer:
• This layer consist of user interface designed for the interaction with end
user. This layer is created in ASP.Net.
• It includes the screens which will be used by the end user for shopping.
• Theses screen show the products with details as per their categories.
• User can select the product to purchase and add them into cart.
• This design is created with advanced controls available in ASP.Net
31
DBMS System Architecture (continued)
2. Business Layer:
• This layer consist of validation checking code related to product
selection of user.
• Accidently user may select wrong number of products to purchase.
• For example if any user is giving order to purchase 10000 TV sets, then
the order should be validated.
• This logical code is implemented using the C# Net.
32
DBMS System Architecture
(continued)
3. Data Layer:
• This layer contains the code interacting with database on the server.
• For example accessing product details from database, inserting
transaction details of user order in database etc.
• This database handling is implemented using the ADO.Net
Here all the three layers work independently and efficiently.
33
Three tier Architecture: Advantages
• In three tier architecture we can manage the data independently.
• Can make the changes in presentation layer without affecting other
two tiers.
• As each tier is independent it is possible to use different groups of
developers
• It is most secure since the client doesn't have direct access to the
database layer.
• When one tier fails there is no data loss, because you are always
secure by accessing the other tier.
• Due to distributed deployment of application server, scalability is
increased.
• It is reusable.
• It is robust and secure due to multiple layers. 34
Three tier Architecture:
Disadvantages
• It is more complex structure.
• More difficult to set up and maintain it.
• The physical separation of the tiers may affect the performance.
35
Components of DBMS
• DDL Compiler
• The DDL Compiler converts
DDL commands into set of
tables containing metadata
stored in a data dictionary.
• The metadata information is
• name of the files
• data items
• storage details of each file
• mapping information and
constraints etc.
37
Components of DBMS
• DML Compiler and Query optimizer
• The DML commands such as retrieve,
insert, update, delete etc. from the
application program are sent to the
DML compiler for compilation.
• It converts these commands into object
code for understanding of database.
• The object code is then optimized in
the best way to execute a query by the
query optimizer and then send to the
data manager.
38
Components of DBMS
Data Manager
• The Data Manager is the central software
component of the DBMS also knows as
Database Control System
• The main functions of Data Manager are :
• It converts the requests received from query
optimizer to machine understandable form
so it makes actual request inside the
database
• Controls DBMS information access that is
stored on disk.
• It controls handling buffers in main memory.
• It enforces constraints to maintain
consistency and integrity of the data.
• It synchronizes the simultaneous operations
performed by the concurrent users. 39
• It also controls the backup and recovery
operations.
Components of DBMS
Data Dictionary
• Repository of description of data in the
database.
• It contains information about Data - names of
the tables, names of attributes of each table,
length of attributes, and number of rows in
each table, Relationships between database
transactions
• Constraints on data i.e. range of values
permitted.
• Detailed information on physical database
design such as storage structure, access paths,
files and record sizes.
• Access Authorization - description of database
users their responsibilities and their access
rights.
• Usage statistics such as frequency of query
and transactions.
• Data dictionary is used to actually control the 40
data integrity and accuracy.
• It may be used as an important part of the
DBMS.
Components of DBMS
Data File
• It contains the data portion of the
database i.e. it has the real data
stored in it.
• It can be stored as magnetic disks,
magnetic tapes or optical disks.
Compiled DML
• The DML compiler converts the high
level Queries into low level file
access commands known as
compiled DML.
• Some of the processed DM
statements (insert, update, delete)
are stored in it so that if there is
similar requests, the data can be
reused. 41
Components of DBMS
End Users
• They are the real users of the
database.
• They can be
• Database developers
• Database Designers
• Database administrator
• Actual users of the database
42
Database Administrator
• A database administrator (DBA) is a person who directs or performs
all activities related to maintaining a successful database
environment.
• Responsibilities include
• Designing
• Implementing and maintaining the database system
• Establishing policies and procedures pertaining to the
management
• Security, maintenance
• Training employees in database management and use
• The life cycle of database begins with designing, and ends with final
implementation.
• All the types of databases need to be designed accurately so that it
should work without any problems.
Database Administrator
• After completion of design, it needs to be installed.
• After this step, users start using the database.
The database grows as the data grows in the database. When
the size of database becomes huge, its performance may fall down.
• Also accessing the data from such huge database becomes
challenge.
There will be unused memory in database, making the
memory inevitably huge.
• These administration and maintenance of database is taken care by
database Administrator - DBA.
Database Administrator
• The important difference between database user and database
administrator is that:
• Database users are only concerned with use of database as per
their need
• Database administrator has to manage and maintain the
database.
• A DBA has many responsibilities. A good performing database is in
the hands of DBA.
Database Administrator: Functions
• Installing and upgrading the database server and application tools
• Allocating system storage and planning future storage
requirements for the database system
• Modifying the database structure, as necessary, from information
given by application developers
• Enrolling users and maintaining system security
• Ensuring compliance with database vendor license agreement
• Controlling and monitoring user access to the database
• Monitoring and optimizing the performance of the database
• Planning for backup and recovery of database information
• Maintaining archived data
Database Administrator: Functions
• Backing up and restoring databases.
• Contacting database vendor for technical support.
• Generating various reports by querying from database as per need.
• Managing and monitoring data replication.
47
Database Administrator: Skillset
• Communication skills
• Knowledge of database Queries, Database Theory and Database
Design
• Knowledge about the RDBMS itself, e.g. Microsoft SQL Server or
MySQL
• Knowledge of Structured Query Language (SQL), e.g. SQL or
Transact-SQL
• General understanding of distributed computing architectures, e.g.
Client-server model
• General understanding:
• operating system, e.g. Windows or Linux
• storage technologies and networking
48
• routine maintenance, recovery, and handling failover of a
database
DBMS Languages
• Those who design and develop the DBMS software and related
tools, and the computer systems operators (called “Workers
Behind the Scene”).
52
Database Users (contd..)
• Actors on the scene
• Database administrators:
• Responsible for authorizing access to the database, for
coordinating and monitoring its use, acquiring software and
hardware resources, controlling its use and monitoring
efficiency of operations.
• Database Designers:
• Responsible to define the content, the structure, the
constraints, and functions or transactions against the
database. They must communicate with the end-users and
understand their needs.
53
Database Users(contd..)
• Logical designers: identify data and relationships between them
for application without taking into account how software will be
used
• Physical designers: look at how database model can be best
mapped to physical storage(hard disk)
56
Thank You!!
57