0% found this document useful (0 votes)
7 views28 pages

Chapter Legacy Databases

legacy db by bart

Uploaded by

sureshkaswan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views28 pages

Chapter Legacy Databases

legacy db by bart

Uploaded by

sureshkaswan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Legacy Databases

[Link]
Introduction
• Hierarchical Model
• CODASYL Model

2
Hierarchical Model
• The hierarchical model originated during the
Apollo program conducted by NASA
– IBM developed the Information Management System
or IMS DBMS (1966-1968)
• No formal description available and lots of
structural limitations (legacy)
• Two key building blocks: record types and
relationship types

3
Hierarchical Model
• A record type is a set of records describing similar
entities and has 0, 1 or more records
– Examples: product record type, supplier record type
• A record type consists of fields or data items
– Examples: product number, product name, product
color

4
Hierarchical Model
• A relationship type connects two record types
• Only hierarchical structures are allowed (1:N
relationship types)
• A record type can be a parent in multiple parent/child
relationship types, but it can participate in at most
one relationship type as a child
• Relationship types can be nested
• Root record type sits as the top of the hierarchy,
whereas leaf record type sits at the bottom
5
Hierarchical Model

PARENT RECORD TYPE

1..1

1:N relationship type!

0..N

CHILD RECORD TYPE

6
Hierarchical Model
DEPARTMENT

DNR dname dlocation

EMPLOYEE PROJECT

SSN ename address PNR pname pduration

7
Hierarchical Model
• All data needs to be retrieved by navigating down
from the root node (procedural DML)
• The hierarchical model is also very rigid and thus
limited in terms of expressive power
• No support for N:M or 1:1 relationship types
• N:M relationship type
– assign one record type as the parent and the other as
the child record type
– put relationship type attributes in child record type
– however: redundancy is introduced! 8
Hierarchical Model

PROJECT PROJECT PROJECT

10 15 20

EMPLOYEE EMPLOYEE EMPLOYEE

110 110 110


EMPLOYEE EMPLOYEE EMPLOYEE

120 EMPLOYEE 150 140 EMPLOYEE

145 150

9
Hierarchical Model
• Another option for an N:M relationship type is to
create two hierarchical structures and connect
them using a virtual child record type and a virtual
parent/child relationship type
– pointers can then be used to navigate between both
structures
– relationship type attributes can be put in the virtual
child record type
– no more redundancy
10
Hierarchical Model
EMPLOYEE
PROJECT Virtual
10 110 parent

Virtual child
Virtual child EMPLOYEE
Virtual
Virtual child
120 parent
PROJECT
15
EMPLOYEE
Virtual
Virtual child 140 parent
Virtual child

PROJECT EMPLOYEE Virtual


20 145 parent

Virtual child
Virtual child EMPLOYEE Virtual
Virtual child
150 parent
11
Hierarchical Model
• 1:1 relationship types should be implemented in
application programs
• The hierarchical model only allows relationship
types of degree 2
– Recursive relationship types or relationship types with
more than 2 record types need to be implemented
using virtual child record types
• A child can not be disconnected from its parent
(on delete cascade)
12
Hierarchical Model
Hierarchical structure 1 Hierarchical structure 2

EMPLOYEE
DEPARTMENT
SSN ename address
DNR dname dlocation

Manages

PROJECT Works at -
Manager

PNR pname pduration - -

Works on

hours
worked

13
Hierarchical Model
• Model limitations
– no guarantee that each department has exactly 1
manager
– no guarantee that a department has at least 1
employee

14
CODASYL Model
• The CODASYL model was developed by the Data
Base Task Group of the COnference on DAta
SYstem Languages in 1969
• CA-IDMS (Computer Associates)
• Building blocks
– record types
– set types
• Lots of structural limitations (legacy)
15
CODASYL Model
• A record type is a set of records describing similar entities
and has 0, 1 or more records or record occurrences
• A record type consists of various data items
• A vector is a multivalued attribute type
– Example: e-mail address
• A repeated group is a composite data item for which a
record can have multiple values or a composite multi-valued
attribute type
– Example: address

16
CODASYL Model
• A set type models a 1:N relationship type between
an owner record type and a member record type
• A set occurrence has 1 owner record and 0, 1 or
more member records
• A CODASYL set has both owner and member
records and it is also possible to order the
member records (↔ mathematical set)

17
CODASYL Model

OWNER RECORD TYPE

0..1

0..N

MEMBER RECORD TYPE

18
CODASYL Model
• A member record can exist without being
connected to an owner record
• A record type can be a member record type in
multiple set types (network structures)
• Multiple set types may be defined between the
same record types

19
CODASYL Model
Bachmann diagram

DEPARTMENT

DNR dname dlocation

works in assigned to

EMPLOYEE PROJECT

SSN ename address PNR pname pduration

20
CODASYL Model
• 1:1 relationship types must be enforced in the application program
• N:M relationship types
– introduce a dummy record type as a member record type in 2 set types having as
owners the record types of the original N:M relationship type

EMPLOYEE PROJECT

SSN ename address PNR pname pduration

Works on

hours
worked

21
CODASYL Model
PROJECT
PROJECT
PROJECT
EMPLOYEE
EMPLOYEE
EMPLOYEE
EMPLOYEE
EMPLOYEE

110 120 140 145 150 10 15 20

Works on Works on Works on


hours worked hours worked hours worked

Works on
hours worked

Works on
hours worked
Procedural DML!
Works on
hours worked

Works on Works on
hours worked hours worked
22
CODASYL Model
• CODASYL allows to logically order the member
records of a set (e.g., alphabetically)
• System can act as the owner for the root record
type (singular or system owned set type)
• No support for recursive set types
– dummy record type needs to be introduced
• No set types with more than 2 participating record
types

23
CODASYL Model
HIERARCHY

SUPERVISES SUPERVISED BY

EMPLOYEE

SSN ename address

WORKS IN MANAGES
WORKS ON
DEPARTMENT hours

DNR dname dlocation

IN CHARGE OF

PROJECT

PNR pname pduration


24
CODASYL Model
HIERARCHY

0. .N 0..1
SUPERVISES SUPERVISED BY
1..1 1..1
EMPLOYEE 1..1

SSN ename address


1. .N 1..1 0. .N
WORKS IN MANAGES
1..1 0..1 WORKS ON
DEPARTMENT hours

DNR dname dlocation 0. .N

1..1
IN CHARGE OF
0. .N

PROJECT
1..1
PNR pname pduration
25
CODASYL
• Model limitations
– an employee can be managed by multiple employees
– no guarantee that a department must have exactly 1
manager
– no guarantee that a department has minimal one
employee

26
Conclusion
• Hierarchical Model
• CODASYL Model

27
More information?

[Link] 28

Common questions

Powered by AI

Procedural DML is crucial for retrieving and manipulating data in both hierarchical and CODASYL databases, as it necessitates explicitly navigating the structural paths set by each model . In hierarchical databases, this means users must traverse predefined parent-child paths to access data, limiting flexibility and necessitating intricate navigation routes from the root node downward . In contrast, CODASYL's procedural DML allows navigating through network structures, which, though still requiring precise navigation instructions, enables more varied access patterns due to the model’s inherent flexibility in entity association via multiple set types . As a result, procedural DML in CODASYL accommodates more complex data queries and operations compared to its hierarchical counterpart.

In the hierarchical model, a record type represents a collection of records describing similar entities, with each record consisting of fields like product number or name . These record types form tree-like structures with strict parent-child relationships . Conversely, the CODASYL model also defines record types as collections but allows them to be part of multiple set types, facilitating more complex network connections between data entities . Additionally, CODASYL introduces vectors and repeated groups to accommodate multivalued and composite attributes within a record type, offering more versatile representations for data .

The CODASYL model expands on the concept of set types by allowing not only hierarchical but also network structures where a member record can associate with multiple owners . This approach facilitates more dynamic and versatile relationship types, such as N:M through dummy records . Unlike the hierarchical model, which strictly imposes a 1:N hierarchy, CODASYL’s set types enable multiple connections without redundancy, support logical ordering of member records, and permit systemic ownership of root record types, thus offering enhanced flexibility and better reflecting real-world relational complexities .

The hierarchical model does not natively support recursive relationships, requiring the use of virtual child record types to handle them, adding complexity and making the structure less intuitive . Conversely, CODASYL does not support recursive set types directly either but introduces dummy record types to implement such relationships, allowing more flexibility in constructing networks without strictly hierarchical constraints . While both models require additional constructs to represent recursion, CODASYL's approach is more integrated with its network model, facilitating better handling of recursion compared to the hierarchical method.

In the hierarchical model, N:M relationship types can introduce redundancy because one record type is designated as parent and the other as child, with relationship attributes added to the child record type . An alternative method in this model involves creating two hierarchical structures connected by a virtual child record type, reducing redundancy but increasing structural complexity . In contrast, the CODASYL model handles N:M relationships by introducing a dummy record type as a member in two set types, each owned by the record types involved in the original relationship, thus avoiding redundancy altogether . The CODASYL approach is more flexible as it allows for more complex network structures and avoids hierarchy-specific constraints.

The hierarchical model is limited by its rigidity and lack of support for various relationship types. It only supports hierarchical structures with 1:N relationship types, disallowing N:M or 1:1 relationships . This restricts its expressive power, making it imperative to navigate data procedurally from the root node . Additionally, the model introduces redundancy when implementing N:M relationships by designating one record type as parent, increasing storage and complexity . Also, since a child record cannot exist without a parent, changes to the structure are cumbersome . These limitations impact usability by restricting flexibility and increasing maintenance complexity.

The hierarchical model does not support 1:1 relationship types natively, relying instead on procedural implementation within application programs . This limitation arises because relationship types in this model are constrained to 1:N hierarchies, making direct representation of 1:1 relationships impractical . To circumvent this, 1:1 relationships must be implemented at the application-level logic, or they can be mapped as virtual child record types to simulate the relationship in the database structure, although this adds complexity and overhead .

In the hierarchical model, data navigation is procedural and involves navigating from the root node downward to retrieve all necessary data, which makes access rigid and limited to predefined paths . Conversely, the CODASYL model offers greater flexibility with its network structure, allowing more complex navigation paths as member records do not rely on a single owner and can connect to multiple set types . While both models use procedural DML, the CODASYL model's network structure simplifies data access patterns by circumventing the linearity of hierarchical navigation.

The hierarchical model introduces redundancy in N:M relationships by having to place the relationship type attributes within the child record type, effectively repeating similar data across records . This redundancy can lead to inconsistencies if updates to shared data attributes are not carefully executed across all affected records, leading to potential data anomalies . Additionally, storage inefficiency is a repercussion, as duplicated data increases database size unnecessarily . While this method simplifies certain queries by having all related data in one place, the long-term impact on data integrity and storage can be substantial.

By using virtual child record types, hierarchical databases can represent complex relationships like N:M or recursive relationships which are not natively supported . This introduces indirect referencing, allowing cross-referencing of separate structures, reducing redundancy, and avoiding direct cyclic dependencies . However, it increases complexity as it requires additional layers of abstraction, increased maintenance costs due to the specialized logic needed to navigate virtual constructs, and potentially hampers performance due to additional lookup operations needed to resolve these relationships . Thus, while functional, using virtual child types complicates the schema and operational management of data.

You might also like