The hierarchical data model was the first database model to be created, first appearing in 1966. It was an improvement on general file-processing systems because it allows the creation of logical relationships between information in a database. However, this structure also has its disadvantages that led to the eventual development of the network model and the relational model.
The main characteristic of a hierarchical data model is the treelike structure. For example, a company database might organize using one branch for Staff, followed by Departments, Teams and then Team Members. This parent-child structure is consistent throughout the database, and each child segment can only have one parent segment. Each segment, or record, can have any number of field elements giving information on that record. For example, the team member record would have details like name, supervisor and contact details.
One-to-Many and Redundancy
Because hierarchical models do not allow for composite records -- that is, for an entry to have more than one parent -- the database has a one-to-many structure; one company can have many departments, and one department can have many team leaders. This can lead to redundancy in the model. For example, a branch below Team Members might be called Ongoing Projects. Since multiple staff members may work on one project, the project information must be duplicated, possibly leading to consistency issues.
Video of the Day
The hierarchical data model is a navigational data model; the access paths in the model are limited by predetermined structures. To obtain a specific file record, the query moves from the root segment in the database down through the branches. This is fine if you already know the location of the records you seek, but if you are making exploratory queries, this is slow, as the database must read all the records on a given level before moving to the next one.
Logical Parent Pointers
The limitations of the hierarchical structure are assuaged somewhat by using logical parent pointers. Developed by IBM in their Information Management System data model, this involves setting up a new database for entries that have many-to-many relationships and linking the two. For example, the Ongoing Projects branch would have pointers that link the user to a separate Projects database where project information is contained. This is similar to how the XML Extensible Markup Language IDREF function works.