0% found this document useful (0 votes)
129 views36 pages

Dbms

The document describes a file-based student system. It consists of a collection of application programs that each define and manage their own data files. Each program stores and controls the files needed for a specific application, leading to data redundancy and separation. The system exhibits program-data dependence and incompatibility between file formats. Some limitations are fixed queries, proliferation of programs, and isolation of data.

Uploaded by

Alexander Aquino
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views36 pages

Dbms

The document describes a file-based student system. It consists of a collection of application programs that each define and manage their own data files. Each program stores and controls the files needed for a specific application, leading to data redundancy and separation. The system exhibits program-data dependence and incompatibility between file formats. Some limitations are fixed queries, proliferation of programs, and isolation of data.

Uploaded by

Alexander Aquino
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

File-based system

aacollection
collectionofof application
application
programs
programs that
that perform
perform
services
servicesfor
for the
theend
endusers
users
such
suchasasthe
theproduction
productionofof
reports.
reports. Student
Courses
Faculty

Registrar File
enrollment
EAF

Data
Dataentry
entryof
of Data
Dataentry
entryof
of Generation
Generationof
of
courses
courses enrollment
enrollment EAF
EAF
Student
File-based system Courses
Faculty

Registrar
File
enrollment
EAF

Data
Dataentry
entryof Data
Each
Each program
program inin the
the
of Dataentry
entryof
of
courses
courses enrollment
enrollment system
system defines
defines and
and
manages
manages its
its own
own data.
data.
struct
structcourse
course [CBS98]
[CBS98]
{{char
charcode[5];
code[5];
char
chardesc[20];
desc[20];
int
intunits
units[3];
[3];
}}
Each
Eachuser
user(with
(withthe
theassistance
assistanceofof File-based
DP
DPstaff)
staff)defines
definesand
andimplements
(including
(includingstorage
storageand
implements
andcontrol)
control)the
the systems
files
filesneeded
neededfor foraaspecific
specific
application.
application.[CBS98,
[CBS98,EN94]
EN94]
Student
Registrar File Courses
Faculty
enrollment
EAF

Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
What
What can
canbe
beobserved?
observed? Data
prepared by:RdDB

Dataredundancy
redundancy
Student System (File-based)
Student
Registrar File Courses
Faculty
enrollment
EAF

Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
What
What can
canbe
beobserved?
observed? Separation
Separationand
and
Student System (File-based) isolation
isolationof
of data
data

Student
Registrar File Courses
Faculty
enrollment
EAF

Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
What
What can
canbe
beobserved?
observed? Program-data
Program-datadependence
dependence
prepared by:RdDB

Student System (File-based)


struct
structperson
person Student
Registrar File Courses
{{char
charfirst[20];
first[20];
Faculty
char
charmiddle[3];
middle[3]; enrollment
EAF
char
charlast[30];
last[30];
}}employees,
employees,managers;
managers;
Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
What
What can
canbe
beobserved?
observed? Incompatibility
Incompatibility of
offiles
filesprepared by:RdDB

Student System (File-based)


COBOL
COBOL Student
Registrar File Courses
Faculty
enrollment
EAF

CC
Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
What
What can
can be
be observed?
observed? Fixed queries;
Fixed queries; prepared by:RdDB

Student System (File-based)


proliferation of application
proliferation of application
programs
programs
Student
Registrar File Courses
Faculty
enrollment
EAF

Student
Accounting File Fees
payment of fees
OR

Department File Student


Processing of Courses
grades course Grades
cards Faculty
Limitations of File-Based Systems
• Separation and isolation of data
• Duplication of data
• Program-data dependence
• Incompatibility of files (e.g C vs. COBOL)
• Fixed queries / proliferation of application
programs
Factors that limit File-Based System

• The definition of data is embedded in


the application programs, rather than
being stored separately and
independently. [CBS98]
• There is no control over the access and
manipulation of data beyond that
imposed by the application programs.
[CBS98]
What is a DBMS?
• Database Management System
• It is a software system that enables
users to :
– define, create and maintain the database
• DDL
• DML
– provide controlled access to this database
• Security
• Integrity
• Concurrency control
• Recovery control
• User-accessible catalogue (description of data)
A Simple Database System
Environment

DATABASE DBMS Software


SYSTEM Software to
Data
process
Definition
programs/
queries
Application
Programs/
Queries
Software to
access stored
data Database
University System: Database
Environment
Registrar
DATABASE MySQL
SYSTEM Software to
Data
process
Definition
programs/
Accounting queries
Enrollment
Payment
Grade processing
Software to
access stored University
Department data database
 Single
Singledatabase
database
Centralized  Single
Workstation 1 SingleDBMS
DBMS
 Users
Users distributed
distributed
across
acrossthe
thenetwork
network
Workstation 2 Workstation 3
 Reliability
Reliabilityand
and
LAN availability
availabilityare
arelow
low––
failure
failureof
of central
centralsite
site
results
resultsin
inloss
lossof
ofthe
the
Database entire
entiredatabase
database
Server with  Communication
Communication
DBMS costs
costsare
arehigh
high
What is a Distributed database?
• A distributed database is a
– logically interrelated collection of shared data
(and a description of this data),
– physically distributed over a computer
network.
What is a Distributed DBMS?
• Distributed DBMS is the software system
that
– permits the management of the distributed
database and
– makes the distribution transparent to users.
Topology of DDBMS
Site 1

DB
Site 4
Site 2
Computer
Network

Site 3

DB DB
DB
Motivation behind DDBMS
1. To integrate the operational data and
provide controlled access to the data.
– This may imply centralization but it is not
the intention
2. To adopt a decentralize approach to
data which mirrors the organizational
structure of many companies.
– Each unit maintains its own data.
– Data is stored proximate to the location
which would improve:
• Shareability of the data
• Efficiency of data access
Motivation behind DDBMS
3. To help resolve the islands of
information problem:
– Geographical separation
– Incompatible computer architectures
– Incompatible communication protocols
Why Distribute??
• Example: X Corp. has offices in London,
New York, and Hong Kong.
• Employee data:
– EMP(ENUM, NAME, TITLE, SALARY, …)
• Where should the employee data table
reside?

(example from Stanford University)


X Corp. Data Access Pattern
• Mostly, employee data is managed at the
office where the employee works
– E.g., payroll, benefits, hire and fire

• Periodically, X Corp needs consolidated


access to employee data
– E.g., X Corp. changes benefit plans and that
affects all employees.
– E.g., Annual bonus depends on global net
profit. (example from Stanford University)
London New York
Payroll app Payroll app

EMP
London
New York

Internet
Hong Kong
Payroll app NY and HK payroll
apps run very slowly!

Hong Kong

(example from Stanford University)


London New York
Payroll app Payroll app

London
Emp NY
London
New York Emp

Internet
Hong Kong
Payroll app
Much better!!

Hong Kong

HK
Emp (example from Stanford University)
Fundamental principle of
DDBMS
• The DDBMS is expected to make the
distribution transparent (invisible) to the
user.
• The objective of transparency:
– To make the distributed system appear like
a centralized system.
Distributed Database System
Data
Data is
is spread
spread over
over multiple
multiple machines
machines (also
(also
referred toAas
referred to Distributed
as sites
sites or System
or nodes).
nodes).
The
The computers
computers maymay vary
vary in
in size
size and
and function
function
A Distributed System
Network
Network interconnects
interconnects the
the machines
machines
Database
Database is is stored
stored on
on several
several sites.
sites.
Data A Distributed System
Data is
is shared
shared byby users
users on
on multiple
multiple machines
machines
Account(actno, br-name, balance) Branch(br-name, br-city,assets)
Add
Add100
100to
toaccount
accountAki-01
Aki-01

Makati Local
Localtransaction:
transaction: IfIf Main
transaction
transactionis
isinitiated
initiated at
at
Makati network
Makatibranch
branch

Q.C. Manila

Account(actno, br-name, balance) Account(actno, br-name, balance)


Account(actno, br-name, balance) Branch(br-name, br-city,assets)

Makati Main
Global:
Global: ififtransaction
transactionisisinitiated
initiated
elsewhere
elsewhere network
Global
Global Transaction
TransactionExample:
Example:
transfer Manila
Q.C. transfer100100pesos
pesosfrom
fromaccount
account
Aki-01
Aki-01(Makati)
(Makati) to toaccount
accountAki-Aki-
100
100(Manila)
(Manila)

Account(actno, br-name, balance) Account(actno, br-name, balance)


Local and Global Transactions
• A local transaction accesses data in
the single site at which the
transaction was initiated.
• A global transaction either:
– accesses data in a site different from
the one at which the transaction was
initiated or (e.g. funds transfer)
– accesses data in several different
sites. (e.g. summarization of deposits
in all branches)
Distributed Database System

Makati Main
network

 A distributed database system consistsManila


Q.C.
of loosely coupled sites that share no
physical component
 Database systems that run on each site
are independent of each other
 Transactions may access data at one or
more sites
Why Distributed Database
Systems?
• Sharing data – users at one site are able
to access the data residing at some
other sites.
• Autonomy – each site is able to retain a
degree of control over data stored
locally.
• Higher system availability through
redundancy — data can be replicated at
remote sites, and system can function
even if a site fails.
Trade-offs in Distributed
Systems
• Disadvantage: added complexity
required to ensure proper
coordination among sites.
–Software development cost.
–Greater potential for bugs.
–Increased processing overhead.
Homogeneous Distributed Database
oracle  All sites have
oracle
identical database
management
system software
 Sites are aware of
Makati each other and
Main agree to cooperate
network in processing user
requests.
Manila  Each site
Q.C.
surrenders part of
its autonomy in
terms of right to
change schemas or
software
oracle oracle  Appears to user as
a single system
Heterogeneous Distributed Database
oracle SQl server  Different sites may use
different schemas and
software (DBMS)
 Difference in
schema is a major
Makati problem for query
Main
processing
network  Difference in
software is a major
Q.C. Manila problem for
transaction
processing
 Sites may not be aware
of each other and may
provide only limited
Sybase DB2 facilities for cooperation
in transaction
processing

You might also like