0% found this document useful (0 votes)
47 views115 pages

1 DBMS- Introduction New (2)

The document provides an overview of Database Management Systems (DBMS), detailing their advantages over traditional file systems, including data independence, integrity, security, and support for concurrent access. It outlines the evolution of database systems from hierarchical to relational models and discusses various data models such as the Entity-Relationship model. Additionally, it highlights the roles of different database users and the importance of ACID properties in ensuring reliable transaction processing.

Uploaded by

rvkaushal.jntuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views115 pages

1 DBMS- Introduction New (2)

The document provides an overview of Database Management Systems (DBMS), detailing their advantages over traditional file systems, including data independence, integrity, security, and support for concurrent access. It outlines the evolution of database systems from hierarchical to relational models and discusses various data models such as the Entity-Relationship model. Additionally, it highlights the roles of different database users and the importance of ACID properties in ensuring reliable transaction processing.

Uploaded by

rvkaushal.jntuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 115

 Database System

 Database Applications
 Database Users
 Advantages of Database Systems
 Data Models
 DataIndependence (Three tier schema architecture)
 Database System Structure
 Client/Server architecture of the Database
DATABASE MANAGEMENT SYSTEM

A Database Management System is software designed to


assist in maintaining and utilizing large collections of data.

DBMS provides an environment that is both convenient and


efficient to use.

1/10/2024
 Drawbacks of using file systems to store data:
◦ Data redundancy and inconsistency
 Multiple file formats, duplication of information in different
files
◦ Difficulty in accessing data
 Need to write a new program to carry out each new task
◦ Data isolation
◦ Integrity problems
 Integrity constraints (e.g. account balance > 0) become part
of program code
 Hard to add new constraints or change existing ones

1/10/2024
 Drawbacks of using file systems (cont.)
◦ Atomicity of updates
 Failures may leave database in an inconsistent state with partial
updates carried out
 E.g. transfer of funds from one account to another should either
complete or not happen at all
◦ Concurrent access by multiple users
 Concurrent accessed needed for performance
 Uncontrolled concurrent accesses can lead to inconsistencies
 E.g. two people reading a balance and updating it at the same
time
◦ Security problems
 Database systems offer solutions to all the above problems

1/10/2024
 Ancient Times: RAM was expensive and limited, lower the productivity of
programmer.
 1960’s: File-base system and data maintained in a flat file.

 1970’s: Era of non-relational database (CODASYL DSTG model, IDMS was


popular)
 1980’s: Era of relational database and Database Management System (DBMS).
 1990’s: The era of OODBMS, ORDBMS and XML
 Early 21st: Started with Y2K(Year 2000) problem and right now Sybase or SQL
Server‟s transact SQL, PostgresSQL and Oracle‟s PL or SQL are used to handle
all the databases. IBM, Microsoft and Oracle dominated the market share of
databases

DBMS Introduction 1/10/2024


 1960 – Charles Bachman designed the first DBMS system
 1970 – Codd introduced IBM‟S Information Management System (IMS)
 1976- Peter Chen coined and defined the Entity-relationship model, also
known as the ER model
 1980 – Relational Model becomes a widely accepted database component
 1985- Object-oriented DBMS develops.
 1990s- Incorporation of object-orientation in relational DBMS.
 1991- Microsoft ships MS access, a personal DBMS, and that displaces all
other personal DBMS products.
 1995: First Internet database applications
 1997: XML applied to database processing. Many vendors begin to
integrate XML into DBMS products.

1/10/2024
1. Real World Entity
DBMS these days is very realistic and real-world entities are used to design its
architecture. Also, behavior and attributes are used by DBMS. To simplify it
we can take an example of an organization database where employee is an
entity and his employee id is an attribute.
2. Self-Describing Nature
A DBMS should be of Self- Describing nature as it not only contains the
database itself but also the metadata. A metadata (data about data) defines and
describes not only the extent, type, structure, and format of all data but also
relationship between data. This data represents itself that what actions should
be taken on it.

1/10/2024
3. Less redundancy and consistency
The DBMS follows the rules of normalization, which splits a relation when there
is more than one attribute with the same value.
Normalization is a method of reducing data redundancy.
Every relation in a database is consistent, that's the state of consistency.
Attempts to leave databases in different states can be detected with methods and
techniques.
A database management system can give greater consistency than earlier forms
of data storage.

1/10/2024
4. Data security and integrity
DBMS gives security to the information put away in this is on the grounds that
all clients have different rights to access the database. A portion of the client
can get to the entire information in the database while others can get to a small
segment of the database.
 It protects unauthorized access to the database and makes it more secure.

 It brings only consistent and accurate data into the database.

1/10/2024
5. Isolation of data and application
 Program-data independence provides a big relief to database users. In
traditional file management system, structure of data files was defined in the
application programs so the user had to change all the programs that are using
that particular data file.
 But in DBMS, structure of data files is not stored in the program but it is
stored in system catalogue. With the help of this, internal improvement of data
efficiency or any changes in the data do not have any effect on application
software.

1/10/2024
6. Support ACID Properties
DBMS adheres to the concepts of Atomicity, Consistency, Isolation,
and Durability, or ACID Properties.
These concepts are applied to transactions, which operate and play around with
data in a database. In multi-transactional environments, ACID properties help
the database stay healthy in case of failure.

1/10/2024
7. Concurrent Access without Anomalies

With the help of concurrency, economy of the system can be increased.

 Data can be accessed and manipulated in parallel with the help of the DBMS.
Users are unaware of the restrictions on transactions when handling the same
data item.
 DBMS offers multiple views for various clients. A client who is in the Sales
division will have an alternate perspective on the database than an individual
working in the Production office.
 This component empowers the clients to have a concentrated perspective on
the database as indicated by their prerequisites.

1/10/2024
8. Data Persistence
 Persistence means if the data is not removed explicitly then all the data will be
maintained in DBMS.
 Any data stored in the DBMS can never be lost. If system failure happens in
between any transaction then it will be rolled back or fully completed, but data
will never be at risk.

1/10/2024
9. Backup and Recovery
 There are many chances of failure of the whole database. At that time no one
will be able to get the database back and for sure company will be in a big
loss.
 The only solution is to take backup of database and whenever it is needed, it
can be stored back. A database must have this characteristic to enable more
effectiveness.

1/10/2024
11. Multiuser and concurrent access

 Data can be accessed and manipulated in parallel with the help of the DBMS.
Users are unaware of the restrictions on transactions when handling the same
data item.
 DBMS offers multiple views for various clients.
 Ex: A client who is in the Sales division will have an alternate perspective on
the database than an individual working in the Production office.

This component empowers the clients to have a concentrated perspective on


the database as indicated by their prerequisites.

1/10/2024
12. Ease of Access (The DBMS Queries)
DBMS provides ease of access to the data inside the database. We can run a
search query to find any data and the process is way faster than manual
searching and is more reliable.
 The CRUD (Create, Read, Update & Delete) operations are very easy to
perform with a database because of the DBMS queries.

1/10/2024
14. SQL and No-SQL Databases
 There are 2 types of databases (not DBMS): SQL and No-SQL.

 The SQL databases store the data in the form of Tables i.e. rows and columns.
The No-SQL databases can store data in any other form than a table. For
instance: the very popular MongoDB stores the data in the form of JSON
(JavaScript Object Notation).
 The availability of SQL and No-SQL databases provides us with the flexibility
of choosing the method of storing the data as well.

1/10/2024
15. Transactional processing
 Transactions are an essential part of any application.

 Transactions ensure consistency across multiple users accessing the system


at the same time.
 Transaction processing ensures that when there is a problem, everything
remains consistent. When transactions fail due to errors, the entire
transaction should roll back so that no changes made during the failed
operation remain permanent.

1/10/2024
Using a DBMS to manage data has many advantages
 Data Independence – DBMS provides an abstract view of the data that
hides the details of data representation and storage.
 Efficient Data Access – it uses sophisticated techniques to store and
retrieve data efficiently.
 Data Integrity and Security– If database is always accessed through
DBMS, the DBMS can enforce integrity constraints.
 Data Administration– When several users share the data, centralizing the
administration of data can offer significant improvements.
 Concurrent Access and Crash Recovery – DBMS protects the users from
the effects of system failures.
 Reduced Application Development Time – DBMS supports important
functions that are common to many applications accessing data.

1/10/2024
Sector Use of DBMS
For customer information, account activities, payments,
Banking
deposits, loans, etc.

Airlines For reservations and schedule information.


For student information, course registrations, colleges, and
Universities
grades.
It helps to keep call records, monthly bills, maintain balances,
Telecommunication
etc.

For storing information about stock, sales, and purchases of


Finance
financial instruments like stocks and bonds.

Sales Use for storing customer, product & sales information.


1/10/2024
• MySQL
• Microsoft Access
• Oracle
• PostgreSQL
• dBASE
• FoxPro
• SQLite
• IBM DB2
• LibreOffice Base
• MariaDB
• Microsoft SQL Server

DBMS SOFTWARES

1/10/2024
Users are differentiated by the way they expect to interact with
the system

– 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.
– 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.
– End-users: they use the data for queries, reports and some of
them actually update the database content.

1/10/2024
Casual : access database occasionally when needed
Naïve or Parametric : they make up a large section of the end-
user population. They use previously well-defined functions in
the form of “canned transactions” against the database.
Examples are bank-tellers or reservation clerks who do this
activity for an entire shift of operations.
Sophisticated : these include business analysts, scientists,
engineers, others thoroughly familiar with the system
capabilities. Many use tools in the form of software packages
that work closely with the stored database.
Stand-alone : mostly maintain personal databases using ready-
to-use packaged applications. An example is a tax program
user that creates his or her own internal database.
1/10/2024
 Data models describe how a database‟s logical structure is
represented. In a database management system, data models
are essential for introducing abstraction.

 Data models specify how data is connected to each other, and


how they are processed and stored inside the system.

 It defines the data elements and the relationships between the


data elements.

1/10/2024
 Hierarchical Model
 Network Model
 Entity-Relationship Model
 Relational Model
 Object-Oriented Data Model

1/10/2024
 Hierarchical Model was the first DBMS model.
 This model organizes the data in the hierarchical tree structure.
The hierarchy starts from the root which has root data and then it
expands in the form of a tree adding child node to the parent
node.
 This model easily represents some of the real-world relationships
like food recipes, sitemap of a website etc.

 Example: We can represent the relationship between the shoes


present on a shopping website in the following way:

1/10/2024
1/10/2024
 One-to-many relationship: The data here is organized in a tree-
like structure where the one-to-many relationship is between the
data types. Also, there can be only one path from parent to any
node.
 Parent-Child Relationship: Each child node has a parent node but
a parent node can have more than one child node. Multiple parents
are not allowed.
 Deletion Problem: If a parent node is deleted then the child node
is automatically deleted.
 Pointers: Pointers are used to link the parent node with the child
node and are used to navigate between the stored data.

1/10/2024
Advantages of Hierarchical Model
 It is very simple and fast to traverse through a tree-like structure.

 Any change in the parent node is automatically reflected in the


child node so, the integrity of data is maintained.
Disadvantages of Hierarchical Model
 Complex relationships are not supported.

 As it does not support more than one parent of the child node so if
we have some complex relationship where a child node needs to
have two parent node then that can't be represented using this
model.
 If a parent node is deleted then the child node is automatically
deleted.

1/10/2024
 This model is an extension of the hierarchical model. It was the
most popular model before the relational model.
 This model is the same as the hierarchical model, the only
difference is that a record can have more than one parent.
 It replaces the hierarchical tree with a graph.

 Example: In the example below we can see that node student has
two parents i.e. CSE Department and Library. This was earlier not
possible in the hierarchical model.

1/10/2024
1/10/2024
 Ability to Merge more Relationships: In this model, as there are
more relationships so data is more related. This model has the
ability to manage one-to-one relationships as well as many-to-
many relationships.
 Many paths: As there are more relationships so there can be more
than one path to the same record. This makes data access fast and
simple.
 Circular Linked List: The operations on the network model are
done with the help of the circular linked list. The current position
is maintained with the help of a program and this position
navigates through the records according to the relationship.

1/10/2024
Advantages of Network Model
 The data can be accessed faster as compared to the hierarchical
model. This is because the data is more related in the network
model and there can be more than one path to reach a particular
node. So the data can be accessed in many ways.
 As there is a parent-child relationship so data integrity is present.
Any change in parent record is reflected in the child record.
Disadvantages of Network Model
 As more and more relationships need to be handled the system
might get complex. So, a user must be having detailed knowledge
of the model to work with the model.
 Any change like updation, deletion, insertion is very complex.

1/10/2024
Entity-Relationship Model or simply ER Model is a high-level
data model diagram.
In this model, we represent the real-world problem in the
pictorial form to make it easy for the stakeholders to
understand.
It is also very easy for the developers to understand the system
by just looking at the ER diagram.
We use the ER diagram as a visual tool to represent an ER
Model.

1/10/2024
1/10/2024
ER diagram has the following three components:
 Entities: Entity is a real-world thing. It can be a person, place,
or even a concept. Example: Teachers, Students, Course,
Building, Department, etc are some of the entities of a School
Management System.
 Attributes: An entity contains a real-world property called
attribute. This is the characteristics of that
attribute. Example: The entity teacher has the property like
teacher id, salary, age, etc.
 Relationship: Relationship tells how two attributes are
related. Example: Teacher works for a department.

1/10/2024
 Graphical Representation for Better Understanding: It is
very easy and simple to understand so it can be used by the
developers to communicate with the stakeholders.
 ER Diagram: ER diagram is used as a visual tool for
representing the model.
 Database Design: This model helps the database designers to
build the database and is widely used in database design.

1/10/2024
 Simple: Conceptually ER Model is very easy to build. If we
know the relationship between the attributes and the entities
we can easily build the ER Diagram for the model.

 Effective Communication Tool : This model is used widely


by the database designers for communicating their ideas.

 Easy Conversion to any Model : This model maps well to the


relational model and can be easily converted relational model
by converting the ER model to the table. This model can also
be converted to any other model like network model,
hierarchical model etc.

1/10/2024
 No industry standard for notation: There is no industry
standard for developing an ER model. So one developer might
use notations which are not understood by other developers.
 Hidden information: Some information might be lost or
hidden in the ER model. As it is a high-level view so there are
chances that some details of information might be hidden.

1/10/2024
Relational Model is the most widely used model. In this model, the
data is maintained in the form of a two-dimensional table.
All the information is stored in the form of row and columns. The
basic structure of a relational model is tables. So, the tables are
also called relations in the relational model.

1/10/2024
1/10/2024
 Tuples : Each row in the table is called tuple. A row contains all
the information about any instance of the object. In the above
example, each row has all the information about any specific
individual like the first row has information about John.
 Attribute or field: Attributes are the property which defines the
table or relation. The values of the attribute should be from the
same domain. In the above example, we have different attributes
of the employee like Salary, Mobile_no, etc.

1/10/2024
 Simple: This model is more simple as compared to the network
and hierarchical model.
 Scalable: This model can be easily scaled as we can add as many
rows and columns we want.
 Structural Independence: We can make changes in database
structure without changing the way to access the data. When we
can make changes to the database structure without affecting the
capability to DBMS to access the data we can say that structural
independence has been achieved.

1/10/2024
 Hardware Overheads: For hiding the complexities and making
things easier for the user this model requires more powerful
hardware computers and data storage devices.
 Bad Design: As the relational model is very easy to design and
use. So the users don't need to know how the data is stored in
order to access it. This ease of design can lead to the development
of a poor database which would slow down if the database grows.

 But all these disadvantages are minor as compared to the


advantages of the relational model. These problems can be
avoided with the help of proper implementation and organization.

1/10/2024
 The real-world problems are more closely represented through
the object-oriented data model.
 The object-oriented data model is a combination of object-
oriented programming and relational data model.
 In this data model, the data and their relationship are represented
in a single structure which is known as an object.
 Since data is stored as objects we can easily store audio, video,
images, etc in the database which was very difficult and
inconvenient to do in the relational model

1/10/2024
1/10/2024
 The object-relational data model is an integration of the object-
oriented model and the relational model.
 It inherits properties from both of the models it supports objects,
classes, etc like object-oriented models, and tabular structures
like the relational model.
 It provides data structures and operations used in the relational
model and also provides features of object-oriented models like
classes, inheritance, etc.

 The only drawback of this data model is that it is complex and


quite difficult to handle.

1/10/2024
1/10/2024
1/10/2024
Data abstraction is the method of hiding the unimportant details
that are present in the database from the end users to make the
accessing of data easy and secure.
All the databases have complex data structures which are, in fact,
of no use to an end user. Thus, these internal irrelevant details
are hidden from the user, making the accessing of data simple
and increasing the security of the data as well.

1/10/2024
The data in DBMS is described at three levels of abstraction

1/10/2024
The data in DBMS is described at three levels of abstraction
 Physical or Internal Level
 Logical or Conceptual Level
 View or External Level

Changing anything at a higher level can never affect the schema at a lower level.

1/10/2024
 Physical level describes how a record (e.g., customer) is stored
on secondary storage device.
 Logical level: describes the stored data in terms of the data
model of the DBMS.
type customer = record
name : string;
street : string;
city : integer;
end;
 View level: application programs hide details of data types.
Views can also hide information (e.g., salary) for security
purposes.

1/10/2024
 This is the layer of data abstraction where the raw data is
physically stored as files.
 This layer contains all the complex data structures and the data
accessing methods defined.
 The physical layer is the lowest level of data abstraction in
a DBMS.
 It is the database administrator who decides how the data is to be
stored in these physical hard drives.

1/10/2024
Example:
When we access data we may get a single data or a table of data.
Moreover, by the term "relational database" we visualize a
table of rows and columns. But at a physical level, these tables
are stored in hard drives which are located at a very secure
data center.

1/10/2024
 After taking the raw data from the physical or internal level,
the structure of the data is defined at the logical or conceptual
level.
 This is like a blueprint of the raw data.
 This layer does not have any information about how the end
user will view the data.

1/10/2024
Example:
 We have data of a few products like product id, product name,
and manufacturing date, and we have another set of data of
customers containing customer id, customer name, and
customer address.
 Now, we need to frame this data in proper tables of products
and customers. After that, we can even frame a join to show
which product has been ordered by which customer.

1/10/2024
 This is what an end-user gets to see. He/she does not get the
entire database, but depending on the queries made from the
front-end the user gets to see the data.
 It may be a single data from the entire database or a collection of
data in tabular format.
 Multiple views of the same data are available to the user, the
representation can be a table, a graph, or a pie chart.
 View Level is the highest level of data abstraction in DBMS.

1/10/2024
Example:
let us say a customer wants to view the order history, he gets to
see only the orders he had made in the past. Now, let us say a
shop owner needs to see the products that are on the order list.
He gets to see a table containing all the info about the products
and the customers to whom they need to be delivered.

1/10/2024
Data independence is the ability to modify one level of a DBMS
without affecting the next higher level's data structure or
access methods.
It's of two types,
 Physical data independence
 Logical data independence

1/10/2024
 The system holds metadata which makes it easier to find and
retrieve data.
 Once a set of metadata in DBMS has been saved in a database,
changing or updating the metadata is challenging.
 Updating the schema or data would be a time-consuming and
complicated task if all of the data were dependent.
 To address the problem with updating metadata, it is organized in
a tiered structure, so that changing data at one level does not affect
data at another. This information is self-contained, however, all
this information is linked to one another.
 So, data independence aids in the separation of data from the
applications that use it.

1/10/2024
This is defined as the ability to modify the physical schema of the
database without the modification causing any changes in the
logical/conceptual or view/external level.

1/10/2024
• Physical data independence allows you to distinguish between
conceptual and internal/physical levels.
• It allows you to describe the database logically without needing
to identify physical structures.
• Physical data independence allows you to modify physical
storage structures or devices without affecting the conceptual
model of the database.
• Any changes made at the internal level would be absorbed by
the mapping between the conceptual and internal levels,
preventing any modifications to the conceptual level.

1/10/2024
• Changing from one data structure to another.
• Making use of new storage technology, such as a hard drive or
magnetic tapes
• Change the location of the database from one drive to another.
• Changing the database's file organization.

1/10/2024
Logical data independence is the ability to modify logical
schema without causing any unwanted modifications to the
external schema or the application programs to be rewritten.

1/10/2024
• Logical data is database data, which means it stores information
about how data is managed within the database.
• Logical data independence is a method that makes sure that if we
make modifications to the table format, the data should not be
affected.
• The mapping between the external and conceptual levels will
absorb any changes made.
• In other words, to distinguish the external level from the
conceptual view, logical data independence is used. Any
modifications to the conceptual representation of the data will not
affect the user's view of the data.

1/10/2024
• Without rewriting current application scripts, you can add,
modify, or delete a new attribute, entity, or relationship.
• To divide an existing record into two or more records.
• Merging two records into a single one.

1/10/2024
1/10/2024
When a schema at a lower level is changed, only the mappings
between this schema and higher-level schemas need to be
changed in a DBMS that fully supports data independence.
The higher-level schemas themselves are unchanged. Hence,
the application programs need not be changed since they refer
to the external schemas
• Logical Data Independence: The capacity to change the
conceptual schema without having to change the external
schemas and their application programs.
• Physical Data Independence: The capacity to change the
internal schema without having to change the conceptual
schema.

1/10/2024
1/10/2024
• Database Management System is the combination of a Database
and all the functionalities to organize and manage the data.

• It is software that allows us to efficiently interact with data at


various levels of abstraction.

• A Database Management System has three major components


o Query Processor
o Storage Manager
o Disk Storage

1/10/2024
1/10/2024
The Disk Storage in the Structure of DBMS represents the space
where data is stored. It has the following components
• Data Files, stores the database itself.
• Data Dictionary, stores metadata about the structure 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.
• Statistical Data, It stores statistical information about the data
stored in the database, like the number of records, blocks, etc. in
a relation. This information can be used to execute a query
efficiently and also to perform Statistical analysis.

1/10/2024
The data dictionary stores,
• Names of relations
• Names of the attributes of each relation
• Domains, and lengths of attributes
• Names of views defined on the database, and definitions of
those views
• Names of authorized users
• Accounting information about users
• Number of Tuples in each relation
• Method of storage used for each relation
• Name of the index, Name of the relation being indexed
• Attributes on which the index is defined
• Type of index formed

1/10/2024
1/10/2024
• A Storage manager is a program module that provides the
interface between the low level data stored in the database and
the application programs and queries submitted to the system.
• Storage manager translates the DML statements into low-level
file-system commands.
• This component in the Structure of DBMS is responsible for the
constraints applied to the data so that it remains consistent.
• Storage manager is responsible for storing, retrieving, and
updating data in the database.

1/10/2024
The Storage Manager components include
• Authorization and Integrity Manager, tests for the
satisfaction of integrity constraints and checks the authority of
users to access data.
• Transaction Manager, ensures that concurrent executions
proceed without conflicting.
• File Manager, manages the allocation of space on disk storage
and data structures used to represent the information stored on
disk.
• Buffer Manager, responsible for fetching data from disk
storage into main memory. It enables the database to handle
data sizes that are much larger than the size of main memory.

1/10/2024
Data integrity is the assurance that digital information is uncorrupted
and can only be accessed or modified by those authorized to do so.

Data integrity describes data that's kept complete, accurate,


consistent and safe throughout its entire lifecycle.

1/10/2024
Data integrity is comprised of common core characteristics:
 Completeness - Data is maintained in its full form and no data
elements are filtered, truncated or lost.
 Accuracy - Data isn't altered or aggregated in any way that
affects data analytics.
 Consistency - Data remains unchanged regardless of how, or how
often, it's accessed and no matter how long it's stored.
 Timeliness - How near to real-time is the data being collected? Old
data is often not useful.
 Compliance. Does the data meet compliance standards, such as
data privacy regulations and other regulations?

1/10/2024
Maintaining data integrity requires an understanding of the two types
of data integrity,
 Physical integrity

 Logical integrity

1/10/2024
Physical integrity is the protection of the completeness and accuracy
of that data as it‟s stored, maintained in storage, and retrieved.
When natural disasters strike, the power goes out, or a disk drive
crashes, the physical integrity of data is compromised.

Human error, storage erosion, and a host of other issues can also
make it impossible for data processing managers, system
programmers, applications programmers, and internal auditors to
obtain accurate data.

1/10/2024
 Even when the hardware devices and infrastructure are working
flawlessly, there are several considerations that affect
the correctness or sensibility of data within its respective context.
 Logical integrity can be affected by poor software design and
software bugs as well as human error and malfeasance.
 Logical integrity protects data from human error and hackers as
well, but in a much different way than physical integrity does.

1/10/2024
 Entity integrity This ensures that no data element is repeated and
that no critical data entry is blank or null.
 Referential integrity, These rules define how data is stored and
used in a database and that only authorized changes, additions or
deletions can occur. These rules prevent duplicate data, ensure data
accuracy or eliminate inapplicable data.
 Domain integrity. This reflects the format, type, amount and value
range or scope of acceptable data values within a database. For
example, if data is supposed to be numerical, an alphanumeric data
element may be rejected.
 User-defined integrity. These are additional rules and constraints
that are implemented in accordance with the organization's specific
needs and aren't otherwise covered by the first three integrity
types.

1/10/2024
1/10/2024
• The Query Processor receives the queries (requests) from the
user and interprets them in the form of instructions.
• It also executes the instructions received from the DML
Compiler.
• It has the following four components:
• DML Compiler
• DDL Interpreter
• Query Optimizer
• Embedded DML Pre-compiler

1/10/2024
DDL Interpreter, which interprets DDL statements and store the
definitions in the data dictionary, as metadata.
DML Queries:
• Sophisticated or Specialized user‟s requests in a database query
language.
• Each query is submitted to a query tools

• Query tools break down it into DML queries and low-level


instructions.
• These are sent to the DML compiler and Organizer, and the query
evaluation engine for further processing.

1/10/2024
DML Compiler and Organizer
• DML calls are usually started by a special character/code
so that the appropriate code can be generated.
• A special preprocessor, called the DML precompiles,
converts the DML statement to normal procedure calls in the
host language.
• The resulting program is then run through the host-
language compiler, which generates appropriate object code ( a
set of low-level instructions that can be used by query
evaluation engine.)

1/10/2024
Application Program Object Code
• It converts DML statements embedded in an application
program to normal procedure calls in the host language.
• These pre-compilers consult the DML compiler to generate the
appropriate code.
Compiler and Linker
• Application programmer writes program application.
• The source codes compiled by the compiler and linker-linked
application program object code to DML queries and send to
query evaluation engine.

1/10/2024
Query evaluation Engine
• A query can usually be translated into any of a number of
alternative evaluation plans that all give the same result.
• The DML compiler also performs query optimization, that is,
it picks the lowest cost evaluation plan from among the
alternatives.
• This component is responsible for interpreting and executing
the SQL query.

1/10/2024
Query evaluation Engine, contains three major components
Compiler - builds a data structure from the SQL statement and
then does semantic checking on the query such as whether the
table exists, field „exists, etc.
Optimizer - transforms the initial query plan (data structure
created by the compiler), into the sequence of operations usually
pipelined together to achieve fast execution.
It refers to the metadata (dictionary) and statistical information
stored about the data to decide which sequence of operations is
likely to be faster and based on that it creates the optimal query
plan. Both cost and rule-based optimizers are used.
Execution Engine - executes each step in the query plan chosen
by Optimizer. It interacts with the relation engine to retrieve and
store records.

1/10/2024
The Structure of DBMS represents the functional modules
that are employed to process the queries received from the
user, retrieve the data, maintain the changes in the database
and optimize the data retrieval.

1/10/2024
1/10/2024
DBMS architecture describes the structure and how the users are
connected to a specific database system.

It also affects the performance of the database as it helps to design,


develop, implement, and maintain the database management system.

1/10/2024
DBMS Structure DBMS Architecture

logical representation of functional representation of Database design


units

The structure includes the Architecture includes the various


components and programs which entities present in the DBMS and
work under DBMS how user interaction is done with the
database
Includes Components which process Includes entities present in Database
queries, organize data, optimize data and User-Interaction with Database
retrieval
Structure of the Database is only one DBMS Architecture can be a tier-1 or
standard representation of functional tier-2 Architecture depending upon
units of DBMS the Database Design

1/10/2024
1/10/2024
• In this architecture, the database is directly available to the user. It
means the user can directly sit on the DBMS and uses it.

• Any changes done here will directly be done on the database


itself. It doesn't provide a handy tool for end users.

• The 1-Tier architecture is used for development of the local


application, where programmers can directly communicate with the
database for the quick response.

1/10/2024
1/10/2024
In order to learn the Structure Query Language (SQL), we set up our SQL server and the
database on our local system. This SQL server enables us to directly interact with the
relational database and execute certain operations without requiring any network
connection. This whole setup to learn SQL queries is an example of Single-Tier DBMS
architecture.

1/10/2024
• The data isn't changed frequently.
• No multiple users are accessing the database system.
• We need a direct and simple way to modify or access the database
for application development.

1/10/2024
 In the two-tier architecture, the applications from the end of the
client can communicate at the server-side with the database.
 This interaction uses Application Program Interface like ODBC
and JDBC.
 The user interfaces, as well as application programs, run on the
side of the client.
 The server side is responsible to provide the functionalities like
query processing and transaction management.
 To communicate with the DBMS, the client-side application
establishes a connection with the server side.

1/10/2024
1/10/2024
Consider a situation where you went to a bank to withdraw some cash. After entering the
withdrawal amount and the account details on the withdrawal slip, the banker will go
through the server-side database via his credential (API call) and will check whether there is
enough balance present or not. This client-server model is an example of Two-Tier DBMS
architecture.

1/10/2024
The main advantages of having a two-tier architecture over a single
tier are:
 Multiple users can use it at the same time. Hence, it can be used
in an organization.
 It has high processing ability as the database functionality is
handled by the server alone.
 Faster access to the database due to the direct connection and
improved performance.
 Because of the two independent layers, it's easier to maintain.

1/10/2024
The main disadvantages of Two-Tier DBMS Architecture are:
 Scalability - As the number of clients increases, the load on the
server increases. Thereby declining the performance of the
DBMS and, in turn, the client-side application.
 Security - The Direct connection between the client and server
systems makes this architecture vulnerable to attacks.

1/10/2024
• The 3-Tier architecture contains another layer between the client
and server.
• In this architecture, the client can't directly communicate with the
server.
• The application on the client end interacts with an application
server which further communicates with the database system.
• The end-user has no idea about the existence of the database
beyond the application server. The database also has no idea about
any other user beyond the application
• The 3-Tier architecture is used in the case of the large web
application.

1/10/2024
1/10/2024
• Most widely used DBMS architecture.
• Follows Client-Application-Server architecture.
• Enhanced security, data integrity, and scalability.
• Has complexity and maintenance issues because of the extra layer.

1/10/2024
The main advantages of Three Tier DBMS Architecture are:

Scalability - Since the database server isn't aware of any users beyond
the application layer and the application layer implements load
balancing, there can be as many clients as you want.

Data Integrity - Data corruption and bad requests can be avoided


because of the checks performed in the application layer on each
client reques.

Security - The removal of the direct connection between the client


and server systems via abstraction reduces unauthorized access to the
database.

1/10/2024
In Three Tier DBMS Architecture, an additional layer (Application
Layer) is added between the Client and the Server.

This increases the number of layers present between the DBMS and
the end-users, making the implementation of the DBMS structure
complex and difficult to maintain.

1/10/2024
Although DBMS system is useful, it is still not suited for the
specific task mentioned below,
 Not recommended when you do not have the budget or the
expertise to operate a DBMS. In such cases, Excel/CSV/Flat Files
could do just fine.
 For Web 2.0 applications, it‟s better to use NoSQL DBMS

1/10/2024
It may be more desirable to develop customized database
applications under the following circumstances:
 Simple, well-defined database applications that are not expected to
change at all.
 Stringent, real-time requirements for some application programs
that may not be met because of DBMS overhead.
 Embedded systems with limited storage capacity, where a general-
purpose DBMS would not fit.
 No multiple-user access to data.

1/10/2024
 Complexity is a parameter of it because when the internal structure
is observed it is very complex.
 Size becomes an issue because some databases have large size.
 Performance may not run as fast as desired.
 Impact of failure is higher i.e., it makes damage to many parts of
the system.
 Some DBMS have unaffordable prices.
 The requirement of the additional hardware increases cost.
 Also have the cost of conversion.

1/10/2024
In spite of the advantages of using a DBMS, there are a few
situations in which a DBMS may involve unnecessary overhead
costs that would not be incurred in traditional file processing. The
overhead costs of using a DBMS are due to the following:
 High initial investment in hardware, software, and training

 The generality that a DBMS provides for defining and processing


data
 Overhead for providing security, concurrency control, recovery,
and integrity functions

1/10/2024
 Certain industries and applications have elected not to use
general-purpose DBMSs. For example, many computer-aided
design (CAD) tools used by mechanical and civil engineers have
proprietary file and data management software that is geared for
the internal manipulations of drawings and 3D objects.
 Similarly, communication and switching systems designed by
companies like AT&T were early manifestations of database
software that was made to run very fast with hierarchically
organized data for quick access and routing of calls.
 GIS implementations often implement their own data organization
schemes for efficiently implementing functions related to
processing maps, physical contours, lines, polygons, and so on.

1/10/2024

You might also like