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

Lecture 2

The document introduces database systems as a solution to the inefficiencies of file-based systems, highlighting challenges such as data redundancy, isolation, and integrity issues. It explains the key characteristics of databases, including centralized repositories, data integration, and the self-describing nature of data. Additionally, it covers the roles of Database Management Systems (DBMS), their advantages, and when they may not be suitable.

Uploaded by

23-20911-066
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture 2

The document introduces database systems as a solution to the inefficiencies of file-based systems, highlighting challenges such as data redundancy, isolation, and integrity issues. It explains the key characteristics of databases, including centralized repositories, data integration, and the self-describing nature of data. Additionally, it covers the roles of Database Management Systems (DBMS), their advantages, and when they may not be suitable.

Uploaded by

23-20911-066
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Database

System
Introduction

By Aiman Naeem
A file-based system is a method of storing and organizing data
in separate files, where each department or application
manages its own data independently.

Data is stored in different files, with no central repository, which


can lead to inefficiency, redundancy, and inconsistency.

File-Based Challenges with File-Based Systems:

Systems • Data Redundancy: The same data might be stored in multiple files, leading to
wasted storage space and potential inconsistencies.
• Data Isolation: Data is isolated in separate files, making it difficult to access
related information across files without complex procedures.
• Data Integrity Issues: Maintaining consistency across files is challenging, especially
when data is updated in one file but not in others.
• Difficulty in Data Retrieval: Searching and retrieving data often requires writing
custom programs, making it more time-consuming and prone to errors.

The limitations of file-based systems, such as data redundancy,


inconsistency, and inefficiency, prompted the development of
database systems that provide centralized, integrated, and
controlled data management.
The Database Approach

Limitations of File-Based The Need for a New


Systems:
Data Definition Embedded in Application
Approach:
With the limitations of the file-based
Programs: In file-based systems, data is system, a more structured, efficient, and
embedded directly in application code, secure approach was needed—leading to
making it difficult to modify or share the development of databases and
across applications. Database Management Systems (DBMS).
Lack of Control over Data Access: Data
access and manipulation are confined to
the application logic, with no centralized
control or security measures.
 A database is a shared collection of logically
related data and its description, designed to meet
the information needs of an organization.
 Key Characteristics:
 Centralized Repository: A single, large data repository
What is a used by multiple departments and users
simultaneously.
Database  Data Integration: Unlike file-based systems, data in a
database is integrated with minimal redundancy.
 Shared Resource: The database is no longer owned by
one department but is a shared resource across the
organization.
Self-Describing Nature of Databases

Example: If a new field is


The structure of the data is added to a record (e.g.,
The database contains not
stored separately from the adding a "phone number"
only operational data but
application programs, field), the applications
also a description of that
allowing changes to the using the database don't
data, known as metadata
data structure without need to be modified unless
or a data dictionary.
affecting the applications. they specifically use that
field.
Definition: Data abstraction separates the
internal definition of data from the external
definition, allowing changes in the data's
internal structure without affecting how users
interact with it.
Example: In a similar manner to modern
software development, a user interacts with the
"external" view of data (e.g., the "Customer"
Data entity) without knowing how it's structured
Abstractio internally.

n Advantage: This abstraction simplifies updates


and changes to the database structure, as
applications are insulated from these changes.
Entities, Attributes, and Relationships

Entities: Distinct objects or concepts that are represented in the


database (e.g., employees, products, clients).

Attributes: Properties or characteristics of entities that need to


be recorded (e.g., an employee’s name, a product's price).

Relationships: The associations between different entities (e.g.,


a "works for" relationship between employees and
departments).

Example: In the DreamHome case study, entities like Staff and


PropertyForRent are related through a "Manages" relationship.
Example of an Entity-Relationship (ER) Diagram
 A visual representation of the
entities, attributes, and
relationships in a database.
 The ER diagram serves as a
blueprint for designing the
database schema.
 DreamHome Case Study:
 Entities: Branch, Staff,
PropertyForRent, Client,
PrivateOwner, Lease.
 Relationships: Has, Offers,
Oversees, Views, Owns,
LeasedBy, and Holds.
 Attributes: Each entity has its
own set of attributes (e.g.,
staffNo for Staff, propertyNo
for PropertyForRent).
A DBMS is a software system that enables
users to define, create, maintain, and
control access to the database.
The Role of a
DBMS
(Database Functions of a DBMS:
Management
System) • Database Definition: Using DDL (Data Definition
Language) to define the database structure.
• Data Manipulation: Using DML (Data Manipulation
Language) for inserting, updating, deleting, and
retrieving data.
• Query Language: A query language like SQL
enables users to interact with the database in a
flexible and efficient manner.
Characteristics of DBMS
 Integration of Data: The database approach integrates data from various
departments into a centralized repository. This minimizes redundancy and ensures
data consistency across the organization.
 Example: A company's sales and customer data are now stored in a shared
database, reducing multiple data entries for the same information.
 Data Independence: The definition of data is independent of the application
programs. Changes in the data structure don’t require rewriting of the application
code.
 Example: If a field size needs to be changed, only the data definition needs to
be updated, not the applications accessing the data.
 Security and Control: With a centralized DBMS, it is easier to enforce data security
policies, ensuring that only authorized users can access or modify data.
 Recovery Control: In case of a failure (e.g., system crash), the DBMS restores the
database to its last consistent state, ensuring minimal data loss.
 Backup System: The DBMS regularly backs up data to prevent permanent loss in
case of catastrophic failure, allowing organizations to recover quickly.
 If a power failure occurs during a database transaction, the DBMS can roll back
the transaction to ensure the database remains consistent.
Application Programs in a DBMS

Advantage: With a
Definition: Application
centralized database,
programs are software
applications across the
that interact with the
Types: organization can access
database by issuing SQL
the same data in real-
commands to retrieve or
time, providing a unified
modify data.
view of the information.

Online Applications:
Batch Applications: Allow real-time
Used for processing large interaction with the
volumes of data at once. database, typically
through a user interface.
Views in a DBMS
 Definition: A view is a virtual table
derived from the database,
showing a subset of the data
based on specific requirements.
 Benefits:
 Security: Sensitive data can
be hidden from certain users
by restricting their access to
specific views.
 Customization: Different
departments can have
customized views of the data,
tailored to their specific
needs.
 Data Independence: Changes
to the underlying database do
not affect the view if the
structure of the view remains
the same.
Components Hardware: The physical infrastructure where the DBMS runs,
ranging from personal computers to large-scale servers.

of the DBMS
Software: Includes the DBMS itself, operating systems, and
Environment application programs that interact with the database.

Data: The database contains both operational data and


metadata (information about the data).

Procedures: Documentation and rules for the proper


operation of the DBMS, such as backup procedures and
access control guidelines.

People: Users, administrators, designers, and developers


who interact with and manage the DBMS.
Client-Server
Architecture in
DBMS
 In client-server architecture, the
DBMS is installed on a central
server (backend), and users
access it through client
applications (frontend).
 Centralized management of the
database with distributed
access, ensuring scalability and
easier maintenance.
 A central server in London hosts
the database for DreamHome,
while multiple branch offices
access the data through their
local systems.
The DBMS environment involves four
Data and key roles
Database Database Application
End-User
Administrato Designers Developers
rs

Roles in the
DBMS
Environment
Each role is vital to the management,
design, development, and use of the
database.
Manages data
resources and policies.

Data Administrator Responsible for


database planning and

(DA): conceptual/logical
design.
Advises senior
management.

Manages the physical

Database database.
Handles security,

Administrator integrity, and


performance. Role: Data
(DBA): Implements and
maintains the and Database
operational database.
Administrator
s
Some organizations combine DA
and DBA roles, while others
have dedicated teams for each.
Role: Database Designers

Two Types of Logical Design


Designers: Phases: Physical
Logical Database Design:
Designer: Focuses on data
structure, entities, Conceptual Design:
Converts the
relationships, and Independent of technology. logical design
constraints.
into physical
Physical Database Logical Design: Aligned tables and
Designer: Focuses on with a specific data model
storage structures, access (e.g., relational, access methods.
methods, and security. hierarchical).
Responsible for creating
programs that interact with
the database.
Retrieving data

Work from system analyst


specifications.

Inserting data
Use programming
languages to create
Role:
operations for:
Application
Updating data
Developers
Common languages include
third-generation and fourth-
generation languages.
Deleting data
Role: End Users

 The final users of the database system,


categorized as:
 Naïve Users: Use pre-built applications (e.g., checkout
assistants using barcode scanners).
 Sophisticated Users: Use query languages (e.g., SQL)
to perform operations and may develop custom queries.
Evolution of Database Management
Systems

Object-
File-Based Hierarchical Relational Commercial Oriented & Web & XML
ER Model
Systems & Network Model RDBMSs Object- Integration Modern
(1976,
(1960s- DBMS (Mid- (1970, E.F. (1979- Relational (Mid- Trends:
Chen):
onwards): 1960s): Codd): onwards): DBMS 1990s):
(1990s):

Oracle, DB2, Data


Decentralize IBM’s IMS Addressed Enabled Warehousing
Introduced SQL Server, Combined dynamic
d data and IDMS/R. limitations of structured , Data
previous MySQL. object web
storage. database programming Mining,
models. applications Cloud
design and and data
methodology. databases. Databases,
exchange. NoSQL.
Limited data First-generation
sharing and DBMSs but Led to SQL
redundancy lacked data development
issues. independence. and
commercial
RDBMSs.
Control of Data Redundancy

• Reduces storage of duplicate data, eliminating inefficiency.


• Some redundancy may be controlled for better performance.

Data Consistency

• Updates occur in one location, ensuring all users see the latest
data.
• Minimizes data inconsistencies.

More Information from the Same Amount of


Advantages Data

of DBMSs • Integration of data allows departments to access shared


information (e.g., owner details for Contracts Department,
lease details for Sales Department).

Sharing of Data

• Data is available to authorized users across departments,


promoting collaboration and eliminating data silos.
• New applications can be built on existing data without
redefining it.
Improved Data Integrity

• Ensures validity and consistency of stored data with


integrity constraints.
• Enforces rules like salary limits and branch
consistency.
Improved Security

• Protects the database from unauthorized access using


user roles and permissions.
Advantages • Granular control over data access (e.g., different
of DBMSs access for branch managers and sales assistants).

contd. Economy of Scale

• Consolidating data into one database reduces overall


costs.
• Shared budgets for hardware and software enhance
resource allocation.
Balance of Conflicting Requirements
• DBAs prioritize resources for optimal performance
across conflicting departmental needs.

Improved Data Accessibility and Responsiveness

• Data across departments is easily accessible by end


users for better decision-making and reporting.
Advantages • Users can query data in real-time using tools like SQL.

of DBMSs Increased Productivity


contd. • Reduces programming overhead by providing standard
DBMS functions (e.g., data handling, concurrency
control).
• Simplifies application development, saving time and
costs.
Improved Maintenance
• Data is separate from applications, allowing for easier
updates without affecting program logic.

Increased Concurrency

• DBMSs manage simultaneous access, preventing


data loss or corruption from concurrent operations.

Advantages Improved Backup and Recovery


Services
of DBMSs • Automates backup processes, ensuring minimal
contd. data loss in case of system failure.

Enforcement of Standards

• Establishes and enforces consistency in data


formats, naming conventions, and access rules.
DBMS software is complex,
requiring extensive
understanding from
designers, developers, and
Complexity administrators.
Misunderstanding the system
can lead to poor design
decisions.

Large DBMS software requires


Disadvantages Size significant disk space and
memory to run efficiently.
of DBMSs

Costs vary widely based on


system scale (e.g., $100 for
personal DBMS to $1,000,000
Cost of DBMSs for enterprise DBMS).
Ongoing maintenance costs
are also significant.
Additional Large databases require
additional storage and more

Hardware Costs powerful machines to


handle performance needs.

Transitioning from file-based


Cost of systems to DBMSs involves
Disadvantages Conversion
costs, including conversion,
training, and hiring
specialists.
of DBMSs
contd.

While file-based systems


are optimized for specific
applications, DBMSs may
Performance face performance
challenges when handling a
variety of applications
simultaneously.
Simple and Small Applications

If the data needs are straightforward, and the application is small, a full-fledged DBMS may be overkill.

Simple file systems or spreadsheets might be sufficient.

Limited Budget or Resources

DBMSs can be expensive to implement, maintain, and operate.

Small organizations or projects with tight budgets may not justify the investment.

Low Complexity and Static Data

If the data is not expected to grow or change frequently, and the system is not complex, the overhead of a DBMS
may not be necessary.

When Not High-Performance Real-Time Systems

DBMSs may introduce latency due to their complexity.

to Use Real-time systems with strict performance requirements might require more specialized, low-latency solutions.

DBMS Highly Distributed Data

In some cases, when data is highly distributed or frequently changing in an environment like IoT, a DBMS may not be
ideal.
Specialized distributed databases or NoSQL systems might be better suited.

Very Specific Application Needs

Applications with very specific or niche requirements (e.g., proprietary data structures or formats) might require
custom-built systems rather than a generic DBMS.
List List four government sectors in your country that use database systems.

Discuss each of the following terms:


Discuss (a) data (b) database (c) database management system (d) database application program
(e) data independence (f) security (g) integrity (h) views

Describe the role of database management systems (DBMS) in the database


Describe approach. Discuss why knowledge of DBMS is important for database

Any
administrators.

Questions? Describe Describe the main characteristics of the database approach and contrast it
with the file-based approach.

Describe the five components of the DBMS environment and discuss how
Describe they relate to each other.

Discuss the roles of the following personnel in the database environment:


Discuss 1. data administrator 2. database administrator 3. logical database designer
4. physical database designer 5. application developer 6. end-users

You might also like