Open In App

Difference between Hierarchical and Network Data Model

Last Updated : 11 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Data models are essential for specifying data organization, storage, and retrieval techniques in the field of database administration. The Network Data Model and the Hierarchical Data Model are two important concepts that have influenced how databases are created and used. Each of these models has certain benefits and drawbacks and varies in terms of flexibility, structure, and use cases. It is crucial to comprehend the primary distinctions among these models in order to choose the most appropriate one for your particular application requirements.

What is the Hierarchical Data Model?

A hierarchical data model is the oldest type of the data model. It was developed by IBM in 1968. It organizes data in a tree-like structure. Hierarchical model consists of the following :

  • It contains nodes which are connected by branches.
  • The topmost node is called the root node.
  • If there are multiple nodes appear at the top level, then these can be called root segments.
  • Each node has exactly one parent.
  • One parent may have many children.

Characteristics of the Hierarchical Data Model

  • Nodes and Branches: The data is stored in nodes, and each node is connected to its parent node by a branch.
  • Top-level node without a parent, known as the root node.
  • Parent-kid Relationship: A parent may have more than one kid, but each node (child) only has one parent.

Example of Hierarchical Data Model

Think of a database used to hold information about technological devices:

  • Electronics is the root node.
  • TVs and portable electronics are examples of child nodes.
  • Grandchild Nodes: Tube, LCD, and Plasma under televisions. These all stand for different categories under the Television node.

Advantages of Hierarchical Data Model

  • Simple Structure: Because of its tree-like structure, it is simple to comprehend and use.
  • Data Security: A distinct parent-child hierarchy is used to guarantee data security.
  • Effective Data Retrieval: Quick and effective way to query data in hierarchies.

Disadvantages of Hierarchical Data Model

  • The hierarchical data model has limited flexibility since each child node can only have one parent.
  • Insertion and Deletion Anomalies: Problems might occur with the addition or removal of nodes.
  • Absent Data Independence: Modifications to the structure may result in problems with data administration.

Hierarchical data modelIn the above figure, Electronics is the root node which has two children i.e. Televisions and Portable Electronics. These two has further children for which they act as parent. For example: Television has children as Tube, LCD and Plasma, for these three Television act as parent. It follows one to many relationship. 

What is the Network Data Model?

It is the advance version of the hierarchical data model. To organize data it uses directed graphs instead of the tree-structure. In this child can have more than one parent. It uses the concept of the two data structures i.e. Records and Sets. 

Characteristics of the Network Data Model

  • Graph Organization: Graphs are used to organize data and support numerous parent-child connections.
  • Flexibility: Facilitates intricate connections, including many-to-many (m), one-to-many (1:m), and one-to-one (1:1).
  • Data linkage connects records by using linked lists and pointers.

Example of Network Data Model

Think of a database used to hold project and departmental data:

  • Project as the Root Node
  • Offspring Nodes: Projects 1 and 2
  • Multiple Parents: Projects 1 and 2 are connected to Departments B and C, demonstrating the many-to-many link.

Advantages of Network Data Model

  • Offers many ways to retrieve data and supports intricate interactions.
  • No Insertion or Deletion abnormalities: Reduces structural abnormalities by allowing child nodes to have numerous parents.
  • Multiple access pathways are provided for efficient data access, which facilitates record searches.

Disadvantages of Network Data Model

  • The graph structure is more difficult to maintain and build, which is a drawback of the complexity of the network data model.
  • Compared to contemporary relational models, partial data independence offers a restricted degree of data independence.
  • Less Popular: Compared to relational models, it is less often employed because of its complexity.

Network data model 

In the above figure, Project is the root node which has two children i.e. Project 1 and Project 2. Project 1 has 3 children and Project 2 has 2 children. Total there are 5 children i.e Department A, Department B and Department C, they are network related children as we said that this model can have more than one parent. So, for the Department B and Department C have two parents i.e. Project 1 and Project 2. 

Difference Between Hierarchical and Network Data Model

Hierarchical Data ModelNetwork Data Model
In this model, to store data hierarchy method is used.In this model, you could create a network that shows how data is related to each other.
It implements 1:1 and 1:n relations.It implements 1:1, 1:n and also many to many relations.
To organize records, it uses tree structure.To organize records, it uses graphs.
Records are linked with the help of pointers.Records are linked with the help of linked list.
Insertion anomaly exits in this model i.e. child node cannot be inserted without the parent node.There is no insertion anomaly.
Deletion anomaly exists in this model i.e. it is difficult to delete the parent node.There is no deletion anomaly.
It is used to access the data which is complex and asymmetric.It is used to access the data which is complex and symmetric.
When update operation is performed, it suffers from inconsistency problem because of the existence of multiple instances of child records.No such problem exists because of the single occurrence of records while updating.
This model lacks data independence.There is partial data independence in this model.
Less flexible in comparison to the relational model.It is flexible.
When you are searching for a record then firstly you need to visit parent record before retrieving a child record.Searching for a record is easy because of the availability of multiple access paths to reach data item.
Example- IBM’s IMS (Information Management System) implement this model.Example- Oracle. SQL Server, Sybase DBMS implement this model.
 

Conclusion

Each of the two data models—the network and the hierarchical—has advantages and disadvantages of its own. Although it lacks flexibility, the hierarchical model is easy to use and effective for basic parent-child connections. The network approach, on the other hand, allows for intricate many-to-many interactions and offers more flexibility at the expense of complexity. The specifics of the data and how it must be accessible and structured will determine which of these models is best.


Next Article
Article Tags :

Similar Reads