Network Data Model Hierarchical Data Model Trends First Generation DBMS

advertisement
Network Data Model
Hierarchical Data Model
Trends
Net / Hier / Trends - 1
Network Model – Basic Concepts
First Generation DBMS
o Network Data Model
o Hierarchical Data Model
Net / Hier / Trends - 2
Network Model – Basic Concepts
o Data are represented as collection of records
o Relationships are represented as links
o Each record is a collection of fields:
type customer =
record
customer-name: string;
customer-street: string;
customer-city: string;
end
type account =
record
account-number: string;
balance: integer;
end
Net / Hier / Trends - 3
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 4
Network Model – Data-Structure Diagrams
Data-structure diagram:
- Same purpose as an ER diagram.
- Boxes (record types)
- Lines (links)
Network Model – Data-Structure Diagrams
Many to Many:
One to Many from customer to account:
One to One:
Net / Hier / Trends - 5
Network Model – Relating 3 Record Types
A customer may have several accounts, each in a specific branch.
An account may belong to several different customers.
Net / Hier / Trends - 7
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 6
Network Model – Relating 3 Record Types
A link can connect only 2 record types
=> We need to use a new record type (Rlink) as below:
Net / Hier / Trends - 8
Network Model – DBTG Model
Network Model – DBTG Model
o DBTG Model (late 1960s) – First database-standard
specification.
o Using DBTG Sets to discribe inter-record structures.
o Eg. a Depositor (1:M) link:
Consider:
An account, b2 of a1, cannot appear as an account
of any other customer record (the same DBTG set).
But b2 can appear as a member of a branch record
(another DBTG set).
Customer
records
Parents
Account
records
Members
The DBTG Set (Depositor) is {(a1,(b1,b2)), (a2,(b3,b4,b5)), (a3,(b6))}
Net / Hier / Trends - 9
Network Model – DML (DBTG)
Net / Hier / Trends - 10
Network Model – Implementation (DBTG)
DML
o Links are implemented as pointer fields.
o The DML consists of commands to be embedded in
a host language (eg. C).
o Eg. M:1 from account to customer
– In an account record, a pointer is stored to point
to the customer record.
– In a customer record, instead of using multiple
pointers to point to the accounts, we use a ring
structure.
o To select records based on a specified field value.
o To iterate over selected records by repeated
comments.
o To find the owner record from a member.
o To find the members of an owner by iteration.
o To update the database.
Net / Hier / Trends - 11
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 12
Network Model – Implementation (DBTG)
Network Model vs Relational Model
o Difficult to implement M:N using pointers
The Network Model
o Therefore, DBTG Model does not allow M:N links.
o It is closely tied to the implementation
o To describe M:N relationships, a new dummy record
type is required (ie. using two 1:M links) :
increases the burden on the programmer for DB
design and data manipulationship.
o Is efficient compared with early relational
implementations.
Net / Hier / Trends - 13
Net / Hier / Trends - 14
Hierchical Model
Hierchical Model – Tree-Structure Diagrams
o Also use Records, Links (similar to Network Model)
o Database is collection of rooted trees => forest
Tree-structure diagram (cf. Data-structure diagram )
o No cycle (cf. arbitrary graph in Network Model)
o Only 1:1 and 1:M can be directly represented
Net / Hier / Trends - 15
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 16
Hierchical Model – Tree-Structure Diagrams
Hierchical Model – Sample Database Trees
o For M:N relationships, we need 2 separate treestructure diagrams.
Net / Hier / Trends - 17
Net / Hier / Trends - 18
Hierchical Model – Tree-Structure Diagrams
Hierchical Model – Implementation
o For the following relationships between branch,
account, and customer:
o To avoid record duplication, use virtual records:
we need 2 separate tree-structure diagrams:
Net / Hier / Trends - 19
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 20
Hierchical Model – Implementation
Hierchical Model – IMS
Implementation example:
IMS: Information Management System (IBM,mid-1960s)
- One of oldest and most widely used DB system
- The first to deal with the issues of concurrency,
recovery, integrity, efficent query processing.
- Similar disadvantages and impact as Network
Model.
Net / Hier / Trends - 21
Net / Hier / Trends - 22
Trends – Distributed DBMSs
Distributed Database
A logically interrelated collection of shared data
(and a description of this data), physically
distributed over a computer network.
Trends
o Distributed DBMS
o Object DBMS
Distributed DBMS
Software system that permits the management of
the distributed database and makes the distribution
transparent to users.
Net / Hier / Trends - 23
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 24
Trends – Distributed DBMSs
Trends – Distributed DBMSs
Distributed DBMSs
Three key issues:
Fragmentation
Relation may be divided into a number of subrelations, which are then distributed.
Allocation
Each fragment is stored at site with "optimal"
distribution.
Replication
Copy of fragment may be maintained at several sites.
Net / Hier / Trends - 25
Trends – Distributed DBMSs
Advantages
o Organizational Structure
o Shareability & Local
Autonomy
o Improved Availability
o Improved Reliability
o Improved Performance
o Economics
o Modular Growth
Trends – Object DBMSs
Disadvantages
o Complexity
o Cost
o Security
o Difficult Integrity
Control
o Lack of Standards
o Lack of Experience
o Complex DB Design
Net / Hier / Trends - 27
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 26
The needs of advanced DB applications:
o Computer-Aided Design (CAD)
o Computer-Aided Manufacturing (CAM)
o Computer-Aided Software Engineering (CASE)
o Office Information Systems (OIS) and Multimedia Systems
o Digital Publishing
o Geographic Information Systems (GIS)
Net / Hier / Trends - 28
Trends – Object DBMSs
Trends – Object DBMSs
Object Oriented Concepts
Abstraction
Object : Employee
o Identify essential aspects of an entity and ignore the
unimportant properties.
o Concentrate on what an object is and what it does.
o Delay implementation details.
Attributes :
Name
Date of Birth
Dept.
Salary
o 2 aspects:
Encapsulation
An object contains data structure and operations.
Information hiding
We present external aspects of an object to the
outside world and hide its internal details.
Methods :
Change Salary
Calculate Age
Delete
method void ChangeSalary(int change)
{
Salary = Salary + change;
}
Objects communicate by sending
messages:
Staff_object.ChangeSalary(1000)
Net / Hier / Trends - 29
Trends – Object DBMSs
Trends – Object DBMSs vs Relational DBMSs
Class
o Similar objects can be grouped as a class (cf. a type or
a structure in C)
o Each such object is called an instance (cf. a variable)
Inheritance
o Allows one class to be defined as a special case of a
more general class (subclass / superclass)
Superclass
Person
Employee
Officer
Teller
Customer
Secretary
Debate: Object DBMSs vs Relational DBMSs
OODBMS proponents:
“ Relational DBMSs are satisfactory for standard
business applications but lack the capability of
supporting more complex applications”
Relational supporters:
“ Relational technology is a necessary part of any real
DBMS, and complex applications can be handled by
extensions to the relational model”
Subclass
Net / Hier / Trends - 31
CS3462 Introduction to Database Systems
Helena Wong, 2001
Net / Hier / Trends - 30
Net / Hier / Trends - 32
Trends - Summary
First Generation DBMS - Network and Hierarchical
o Required complex programs for even simple
queries.
o Minimal data independence.
o No widely accepted theoretical foundation.
Second Generation DBMS - Relational DBMS
o Helped overcome these problems.
Third Generation DBMS - OODBMS and ORDBMS
o Response to increasing complexity of DB
applications
Net / Hier / Trends - 33
CS3462 Introduction to Database Systems
Helena Wong, 2001
Download