Sei sulla pagina 1di 9

Network Data Model

First Generation DBMS


Hierarchical Data Model o Network Data Model
Trends o Hierarchical Data Model

Net / Hier / Trends - 1 Net / Hier / Trends - 2

Network Model – Basic Concepts 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 Net / Hier / Trends - 4

CS3462 Introduction to Database Systems


Helena Wong, 2001
Network Model – Data-Structure Diagrams Network Model – Data-Structure Diagrams
Data-structure diagram:
Many to Many:
- Same purpose as an ER diagram.
- Boxes (record types)
- Lines (links)
One to Many from customer to account:

One to One:

Net / Hier / Trends - 5 Net / Hier / Trends - 6

Network Model – Relating 3 Record Types 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. A link can connect only 2 record types
=> We need to use a new record type (Rlink) as below:

Net / Hier / Trends - 7 Net / Hier / Trends - 8

CS3462 Introduction to Database Systems


Helena Wong, 2001
Network Model – DBTG Model Network Model – DBTG Model
o DBTG Model (late 1960s) – First database-standard Consider:
specification.
An account, b2 of a1, cannot appear as an account
o Using DBTG Sets to discribe inter-record structures. of any other customer record (the same DBTG set).
But b2 can appear as a member of a branch record
o Eg. a Depositor (1:M) link:
(another DBTG set).

Customer
Parents records

Account
Members records

The DBTG Set (Depositor) is {(a1,(b1,b2)), (a2,(b3,b4,b5)), (a3,(b6))}


Net / Hier / Trends - 9 Net / Hier / Trends - 10

Network Model – DML (DBTG) Network Model – Implementation (DBTG)

DML o Links are implemented as pointer fields.

o The DML consists of commands to be embedded in o Eg. M:1 from account to customer
a host language (eg. C).
– In an account record, a pointer is stored to point
o To select records based on a specified field value. to the customer record.
– In a customer record, instead of using multiple
o To iterate over selected records by repeated pointers to point to the accounts, we use a ring
comments. structure.
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 Net / Hier / Trends - 12

CS3462 Introduction to Database Systems


Helena Wong, 2001
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 increases the burden on the programmer for DB
type is required (ie. using two 1:M links) : 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


Tree-structure diagram (cf. Data-structure diagram )
o Also use Records, Links (similar to Network Model)
o No cycle (cf. arbitrary graph in Network Model)
o Database is collection of rooted trees => forest
o Only 1:1 and 1:M can be directly represented

Net / Hier / Trends - 15 Net / Hier / Trends - 16

CS3462 Introduction to Database Systems


Helena Wong, 2001
Hierchical Model – Tree-Structure Diagrams Hierchical Model – Sample Database Trees
o For M:N relationships, we need 2 separate tree-
structure diagrams.

Net / Hier / Trends - 17 Net / Hier / Trends - 18

Hierchical Model – Tree-Structure Diagrams Hierchical Model – Implementation

o For the following relationships between branch, o To avoid record duplication, use virtual records:
account, and customer:

we need 2 separate tree-structure diagrams:

Net / Hier / Trends - 19 Net / Hier / Trends - 20

CS3462 Introduction to Database Systems


Helena Wong, 2001
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
Trends distributed over a computer network.

o Distributed DBMS Distributed DBMS


Software system that permits the management of
o Object DBMS
the distributed database and makes the distribution
transparent to users.

Net / Hier / Trends - 23 Net / Hier / Trends - 24

CS3462 Introduction to Database Systems


Helena Wong, 2001
Trends – Distributed DBMSs Trends – Distributed DBMSs
Distributed DBMSs
Three key issues:

Fragmentation
Relation may be divided into a number of sub-
relations, 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 Net / Hier / Trends - 26

Trends – Distributed DBMSs Trends – Object DBMSs


Advantages Disadvantages
The needs of advanced DB applications:
o Organizational Structure o Complexity
o Shareability & Local o Computer-Aided Design (CAD)
o Cost
Autonomy o Security o Computer-Aided Manufacturing (CAM)
o Improved Availability o Difficult Integrity o Computer-Aided Software Engineering (CASE)
o Improved Reliability Control
o Office Information Systems (OIS) and Multimedia Systems
o Improved Performance o Lack of Standards
o Economics o Lack of Experience o Digital Publishing
o Modular Growth o Complex DB Design o Geographic Information Systems (GIS)

Net / Hier / Trends - 27 Net / Hier / Trends - 28

CS3462 Introduction to Database Systems


Helena Wong, 2001
Trends – Object DBMSs Trends – Object DBMSs
Object Oriented Concepts

Abstraction Object : Employee


o Identify essential aspects of an entity and ignore the
Attributes :
unimportant properties. Name
o Concentrate on what an object is and what it does. Date of Birth
Dept. method void ChangeSalary(int change)
o Delay implementation details. Salary {
Salary = Salary + change;
o 2 aspects: }
Encapsulation Methods :
Change Salary
An object contains data structure and operations. Objects communicate by sending
Calculate Age messages:
Information hiding Delete Staff_object.ChangeSalary(1000)
We present external aspects of an object to the
outside world and hide its internal details.
Net / Hier / Trends - 29 Net / Hier / Trends - 30

Trends – Object DBMSs Trends – Object DBMSs vs Relational DBMSs


Class
o Similar objects can be grouped as a class (cf. a type or Debate: Object DBMSs vs Relational DBMSs
a structure in C)
OODBMS proponents:
o Each such object is called an instance (cf. a variable)
“ Relational DBMSs are satisfactory for standard
Inheritance business applications but lack the capability of
o Allows one class to be defined as a special case of a supporting more complex applications”
more general class (subclass / superclass)
Relational supporters:
Person Superclass “ Relational technology is a necessary part of any real
DBMS, and complex applications can be handled by
Employee extensions to the relational model”
Customer

Officer Teller Secretary Subclass

Net / Hier / Trends - 31 Net / Hier / Trends - 32

CS3462 Introduction to Database Systems


Helena Wong, 2001
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

Potrebbero piacerti anche