DBMS > Data Model > What is Hierarchical Data Model of database?
Hierarchical Model
In fact, Hierarchical Model was the first DBMS model. It first appeared in the 1950s and had its heyday in the 1970s and 80s. Hierarchical database model used to organize data in a structure so as to reduce redundancy, better utilze storage space and to increase data integrity. This model easily represents some of the real-world relationships like food recipes, sitemap of a website etc.
This model organises the data in the hierarchical tree structure. The hierarchy starts from the root which has root data and then it expands in the form of a tree adding child node to the parent node. Of course, hierarchical databases still exist, but they aren't nearly as popular as relational model.
Features of a Hierarchical Model
- One-to-many relationship: Data here is organised in a tree-like structure where the one-to-many relationship is between the datatypes. Example: In the above example, if we want to go to the node Manager1 we only have one path to reach there i.e throughChittagong and Accounts node.
- Parent-Child Relationship: Each child node has a parent node but a parent node can have more than one child node. Multiple parents are not allowed.
- Deletion Problem: If a parent node is deleted then the child node is automatically deleted.
- Pointers: Pointers canbe be used to link the parent node with the child node and are used to navigate between the stored data.
Advantages of Hierarchical Model
- It is very simple and fast to traverse through a tree-like structure.
- Any change in the parent node is automatically reflected in the child node so, the integrity of data is maintained.
Disadvantages of Hierarchical Model
- Complex relationships are not supported.
- As it does not support more than one parent of the child node so if we have some complex relationship where a child node needs to have two parent node then that can't be represented using this model.
- If a parent node is deleted then the child node is automatically deleted.