0% found this document useful (0 votes)
6 views22 pages

Database Introduction

A database is an organized electronic collection of data, while a Database Management System (DBMS) is software that enables users to interact with databases. DBMS provides functionalities like data storage, retrieval, security, and backup, addressing issues found in traditional file-based systems. There are various architectures for DBMS, including 1-Tier, 2-Tier, and 3-Tier, each with its own advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views22 pages

Database Introduction

A database is an organized electronic collection of data, while a Database Management System (DBMS) is software that enables users to interact with databases. DBMS provides functionalities like data storage, retrieval, security, and backup, addressing issues found in traditional file-based systems. There are various architectures for DBMS, including 1-Tier, 2-Tier, and 3-Tier, each with its own advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

INTRODUCTION TO DBMS:

What Is a Database
A database is a systematically organized
collection of data stored electronically,
designed to make it easier to store, access,
manage and analyze information, including
words, numbers, images, videos, and files.

A “database” can also refer to a set of


connected data accessed through a Database
Management System (DBMS), which is a
software that allows users to interact with one
or more databases.

Because of the close relationship between


them, the term “database” is often used
casually to refer to both a database and the
DBMS used to manipulate it.
Database vs. Database Management
System (DBMS)
A Database and a Database Management
System (DBMS) are closely related terms, but
they serve different purposes:
 A database is a structured set of data.
The data can be structured or unstructured
and stored in various formats like tables,
documents, and key-value pairs. It could be
anything from a simple shopping list to a
picture gallery or the vast amount of
information in a corporate network.
 A DBMS (Database Management
System) is software used to interact
with a database. It provides an interface
for users or applications to manipulate data,
making the handling of large amounts of
data more efficient and less error-prone. A
DBMS oversees core administrative tasks
such as data storage, retrieval, security,
concurrency control, backup and recovery,
and query processing. Examples include
Oracle Database, MySQL, Microsoft SQL
Server, and MongoDB.
In simpler terms, a database is like a container
that holds the information, while a DBMS is a
tool used to organize and manage the contents
within that container.

What is DBMS?
DBMS or Database Management System is
basically a computerised data-keeping system.
Here, the users of a system are provided with
facilities to perform multiple operations on it.
These are either done to manipulate data in the
database or manage the database structure
itself. The DBMS is primarily categorised
according to its data structures or types.
DBMS (Database Management System) is a
software system that manages, stores, and
retrieves data efficiently in a structured format.
 It allows users to create, update, and
query databases efficiently.
 Ensures data integrity, consistency, and
security across multiple users and
applications.
 Reduces data redundancy and
inconsistency through centralized control.
 Supports concurrent data access,
transaction management, and automatic
backups
Problems with Traditional File-
Based Systems
Before the introduction of modern DBMS, data
was managed using basic file systems on hard
drives. While this approach allowed users to
store, retrieve and update files as needed, it
came with numerous challenges
 Data Redundancy: Duplicate entries
across files
 Inconsistency: Conflicting or outdated
information
 Difficult Access: Manual file search
required
 Poor Security: No control over data access
 Single-User Access: No support for
collaboration
 No Backup/Recovery: Data loss was often
permanent
A university file-based system storing data in
separate files (e.g., Academics, Results,
Hostels) often faced these problems.

Characteristics of DBMS
 DBMS uses a digital repository that is
established on a server for the storage and
management of the information.
 It consists of automatic backup as well as
recovery procedures.
 DBMS can provide a logical and clear view of
the processes that manipulate the data.
 DBMS contains automatic backup and
recovery procedures.
 It consists of ACID properties that maintain
data in a fairly healthy state whenever a
failure occurs.
 DBMS can reduce the overall complex
relationship established between data or
sets of data.
 DBMS can also support data manipulation
and processing.
 It provides data security.
 DBMS can view a database from additional
viewpoints as per the user requirements.

Uses of DBMS
Users can employ DBMS to perform the
following tasks:
 Data Retrieval: Retrieval of the data from
the database that can be used by various
apps for various purposes.
 Data Definition: Creation, modification, or
removal of the data that defines the
database’s organization in the computer
system.
 Data Updation: Insertion, modification, or
deletion of the real data in or from the
database.
 User Administration: Registration and
monitoring of users, maintenance of data
integrity, monitoring performance,
enforcement of data security, concurrency
control and recovering useful information
corrupted due to unexpected failure.

Pros of DBMS
 Multiple User Interface: DBMS provides
users with different types of UI like graphical
UI, application program interfaces (API), etc.
 Controls Database Redundancy: DBMS
can also control data redundancy since it
stores all the information in a single
database file, while this recorded data is put
in the database.
 Reduce Time: It reduces the time of
development and the need for maintenance.
 Data Sharing: Authorised users in an
organization can easily share data and info
among multiple other users in DBMS.
 Easily Maintenance: DBMS can be easily
maintained because of the database
system’s centralised nature.
 Backup: DBMS provides users with
subsystems of backup and recovery that
create an automatic backup of data from
the software and hardware failures. It can
also even restore the data whenever
required.
Cons of DBMS
 Cost of Hardware and Software: We
require a high-speed data processor and a
fairly large memory size in order to run any
DBMS software.
 Size: DBMS occupies large disk space and
fairly large memory in order to run
efficiently.
 Complexity: Additional complexity and
requirements are created by the database
systems.
 Higher Impact of Failure: Failure impacts
the database a lot because, in a majority of
organizations, all the data is usually stored
in a single database. Thus, in case the
database is damaged as a result of any
database corruption or electric failure, then
the data can even be lost forever.
Components of DBMS
Applications
Any DBMS based applications is made up of six
key components that work together to handle
data effectively.
1. Hardware
 Physical devices like servers, disks, input-

output devices (keyboard, monitor,


printer).
 Stores and processes data; interfaces
between real-world inputs and digital
systems.
 Examples: Personal computer hard disk,
RAM, network devices used for DBMS
operations.
2. Software
 Actual DBMS software like MySQL, Oracle,

PostgreSQL.
 Includes the database engine, OS,
network software, and application tools.
 Translates database access languages
into operations.
3. Data
 Raw facts stored in structured or
unstructured formats.
 Operational Data: Actual user data (e.g.,
name, age).
 Metadata: Data about data (e.g., storage
time, size, data type).
 Core reason DBMS exists—to manage and
store data efficiently.
4. Procedures
 Instructions and rules for using DBMS
effectively.
 Covers setup, login/logout, data
validation, backup, access control, and
report generation.
 Helps ensure consistent and secure use of
the system.
5. Database Access Language
 Used to interact with the database
(create, read, update, delete data).
 Examples: SQL, MyAccess, Oracle PL/SQL.
 DDL (Data Definition
Language) – CREATE, ALTER, DROP
 DML (Data Manipulation
Language) – INSERT, UPDATE, DELETE
6. People
 Users interacting with DBMS at different

levels:
 Database Administrators (DBA) –
Manage security, performance, user
access.
 Developers – Build applications using the
database.
 End Users – Use applications to access
the database (e.g., students, employees).
Applications of DBMS
 Banking: Manages accounts and
transactions.
 E-commerce: Tracks products, orders, and
customers.
 Healthcare: Stores patient records and
diagnoses.
 Education: Handles student grades and
schedules.
 Social Media: Manages user profiles and
interactions.
 Data Science: Supports analytics and
predictions.

DBMS Architecture 1-level, 2-Level, 3-


Level
A DBMS architecture defines how users interact
with the database to read, write, or update
information. A well-designed architecture and
schema (a blueprint detailing tables, fields and
relationships) ensure data consistency, improve
performance and keep data secure.
Types of DBMS Architecture
There are several types of DBMS Architecture
that we use according to the usage
requirements.
 1-Tier Architecture
 2-Tier Architecture

 3-Tier Architecture

1-Tier Architecture
In 1-Tier Architecture, the user works directly
with the database on the same system. This
means the client, server and database are all in
one application. The user can open the
application, interact with the data and perform
tasks without needing a separate server or
network connection.

 A common example is Microsoft Excel.


Everything from the user interface to the
logic and data storage happens on the
same device. The user enters data,
performs calculations and saves files
directly on their computer.
 This setup is simple and easy to use,
making it ideal for personal or standalone
applications. It does not require a network
or complex setup, which is why it's often
used in small-scale or individual use
cases.
 This architecture is simple and works well
for personal, standalone applications
where no external server or network
connection is needed.

Advantages of 1-Tier Architecture

Below mentioned are the advantages of 1-Tier


Architecture.
 Simple Architecture: 1-Tier Architecture
is the most simple architecture to set up,
as only a single machine is required to
maintain it.
 Cost-Effective: No additional hardware is
required for implementing 1-Tier
Architecture, which makes it cost-
effective.
 Easy to Implement: 1-Tier Architecture
can be easily deployed and hence it is
mostly used in small projects.

Disadvantages of 1-Tier Architecture

 Limited to Single User: Only one person


can use the application at a time. It’s not
designed for multiple users or teamwork.
 Poor Security: Since everything is on the
same machine, if someone gets access to
the system, they can access both the data
and the application easily.
 No Centralized Control: Data is stored
locally, so there's no central database.
This makes it hard to manage or back up
data across multiple devices.
 Hard to Share Data: Sharing data
between users is difficult because
everything is stored on one computer.
2-Tier Architecture
The 2-tier architecture is similar to a
basic client-server model. The application at
the client end directly communicates with the
database on the server side. APIs like ODBC
and JDBC are used for this interaction. The
server side is responsible for providing query
processing and transaction management
functionalities.

 On the client side, the user interfaces and


application programs are run. The
application on the client side establishes a
connection with the server side to
communicate with the DBMS. For
Example: A Library Management System
used in schools or small organizations is a
classic example of two-tier architecture.
 Client Layer (Tier 1): This is the user
interface that library staff or users
interact with. For example they might use
a desktop application to search for books,
issue them, or check due dates.
 Database Layer (Tier 2): The database
server stores all the library records such
as book details, user information and
transaction logs.
 The client layer sends a request (like
searching for a book) to the database
layer which processes it and sends back
the result. This separation allows the
client to focus on the user interface, while
the server handles data storage and
retrieval.

Advantages of 2-Tier Architecture

 Easy to Access: 2-Tier Architecture


makes easy access to the database, which
makes fast retrieval.
 Scalable: We can scale the database
easily, by adding clients or upgrading
hardware.
 Low Cost: 2-Tier Architecture is cheaper
than 3-Tier Architecture and Multi-Tier
Architecture.
 Easy Deployment: 2-Tier Architecture is
easier to deploy than 3-Tier Architecture.
 Simple: 2-Tier Architecture is easily
understandable as well as simple because
of only two components.
Disadvantages of 2-Tier Architecture

 Limited Scalability: As the number of


users increases, the system performance
can slow down because the server gets
overloaded with too many requests.
 Security Issues: Clients connect directly

to the database, which can make the


system more vulnerable to attacks or data
leaks.
 Tight Coupling: The client and the
server are closely linked. If the database
changes, the client application often
needs to be updated too.
 Difficult Maintenance: Managing
updates, fixing bugs, or adding features
becomes harder when the number of
users or systems increases.
3-Tier Architecture
In 3-Tier Architecture, there is another layer
between the client and the server. The client
does not directly communicate with the server.
Instead, it interacts with an application server
which further communicates with the database
system and then the query processing and
transaction management takes place. This
intermediate layer acts as a medium for the
exchange of partially processed data between
the server and the client. This type of
architecture is used in the case of large web
applications.

Example: E-commerce Store


 User: You visit an online store, search for

a product and add it to your cart.


 Processing: The system checks if the
product is in stock, calculates the total
price and applies any discounts.
 Database: The product details, your cart

and order history are stored in the


database for future reference.

Advantages of 3-Tier Architecture

 Enhanced scalability: Scalability is


enhanced due to the distributed
deployment of application servers. Now,
individual connections need not be made
between the client and server.
 Data Integrity: 3-Tier Architecture
maintains Data Integrity. Since there is a
middle layer between the client and the
server, data corruption can be
avoided/removed.
 Security: 3-Tier Architecture Improves
Security. This type of model prevents
direct interaction of the client with the
server thereby reducing access to
unauthorized data.

Disadvantages of 3-Tier Architecture

 More Complex: 3-Tier Architecture is


more complex in comparison to 2-Tier
Architecture. Communication Points are
also doubled in 3-Tier Architecture.
 Difficult to Interact: It becomes difficult
for this sort of interaction to take place
due to the presence of middle layers.
 Slower Response Time: Since the
request passes through an extra layer
(application server), it may take more
time to get a response compared to 2-Tier
systems.
 Higher Cost: Setting up and maintaining
three separate layers (client, server and
database) requires more hardware,
software and skilled people. This makes it
more expensive.
Data Abstraction
The main goal of data abstraction is to simplify
database management and achieve data
independence. It allows users to work with data
without worrying about how it is stored or
maintained internally, reducing complexity and
improving efficiency. There are mainly three
levels of data abstraction in a DBMS:
1. Physical or Internal Level
2. Logical or Conceptual Level
3. View or External Level

1. Physical or Internal Level

 This is the lowest level of abstraction that


deals with how data is physically stored in
memory.
 It defines file organization techniques (like

hashing or B+ trees) and access methods


(such as sequential or random access).
 Details such as block size, memory
allocation and storage paths are managed
at this level.
 These physical details are hidden from the

end users.
Example: When storing employee details, the
user doesn’t need to know how many memory
blocks are used or where the data is stored on
disk.

2. Logical or Conceptual Level

 This level describes what data is stored in


the database and the relationships among
those data.
 It represents the entire database using
simple logical structures like tables,
attributes and relationships.
 The logical level provides physical data

independence, meaning that changes at


the physical level do not affect this level.
 Database administrators primarily work at

this level to define schemas and


relationships.
Example: At this level, employee details are
represented as tables with fields such as
Emp_ID, Emp_Name and Manager_ID.

3. View or External Level

 This is the highest level of abstraction,


where users interact directly with the
database.
 It provides different views of the same

data for different users, ensuring security


and simplicity.
 Users access data through Graphical User

Interfaces (GUI) or Command-Line


Interfaces (CLI) without dealing with the
underlying complexity.
Example: A user may view only the
Emp_Name and Department columns, while
other details remain hidden.

Data Independence
Data Independence is the property that allows
changes in the database schema at one level
without requiring changes at the next higher
level. It helps separate data from the programs
that use it, thereby improving flexibility and
minimizing maintenance effort.

Example of Data Independence

Consider a database storing customer


information:
 Physical level: Stores data in files and
manages memory blocks.
 Logical level: Represents customers as a

table with attributes


like Customer_ID, Name and Phone.
 View level: A user may see
only Name and Phone fields.
Note: If the storage method changes (physical
level) or a new column Email is added (logical
level), the user view remains unaffected -
demonstrating data independence.
There are two types of data independence:
1. Physical Data Independence
2. Logical Data Independence

1. Physical Data Independence


 It refers to the ability to change the
physical storage of data without affecting
the logical schema.
 Changes like altering indexes, switching

file organization methods or upgrading


storage devices do not affect the
conceptual structure of the database.
Examples:
 Changing from sequential file organization

to hashing.
 Using a new storage device or modifying

access paths.
Benefit: It allows performance optimizations
at the physical level without modifying higher-
level structures.

2. Logical Data Independence

 It refers to the ability to modify the logical


schema (tables, attributes, relationships)
without affecting the user views or
application programs.
 Users can continue to access data without

changes in their queries even if new fields


are added or relationships modified in the
conceptual schema.
Examples:
 Adding or deleting attributes in a table.

 Changing the relationship between


entities.
Benefit: , It allows the database to evolve
without disturbing existing applications.

You might also like