What is a hierarchical data model? It is basically a data modelling method where the data are structured into a tree-like structure starting from top to bottom. The data actually is stored as multiple records that are related to each other via different links. A record is simply a set of associated fields, each having just one value.
In a hierarchical data model, every entity stores a copy of all its relevant relationships as well as update them in a transaction when a change is made on any of the objects it is dependent on. This transaction happens when an update is required or some changes to an entity's attributes occur. In an object-oriented database, the change that causes the database to update its records occurs at the point of a database query.
There are several reasons why a business may choose a hierarchical data model. For example, in a hierarchy, ordering is easier to achieve. Another advantage is performance. With a hierarchical data model, there is less need for concretization and updates since all changes are done at the structural level, not at the entity level. This makes it a good choice for large, multi-dimensional data or even a complex collection of related objects.
But what if you have a lot of duplicate records, for instance, if your database has twenty parent keys and ten child keys, would you still be able to create and update them? If you use the normal database design, then yes, you would. You could create, update and delete from one parent to twenty children, but if you have a lot of parents and children, you'd have to recreate all twenty records. And if you have thousands of records, this can be very time-consuming. The solution for such situations is to create and maintain a hierarchical data model.
In a hierarchical data model, entities are classified into parents and children. One key represents a child and all of its relations are contained in its parent. A child's key is always a subset of its parent's. So, a record like "Person A" has a key called "A" and it contains one or more subkeys depending on the nature of the relationship between the two entities. In the hierarchy, the relationship among all the entities is represented by a hierarchical key.
However, in the case of a normal database, a simple key/value dictionary can solve this problem. An example will illustrate this point. Consider a business records database with the following structure: name, address, phone number, company name, job title, department name, human resource information, employment history, last name, gender, contract date, contract start date, contract end date. If we try to create a data hierarchy from the above data, we would certainly need a large amount of space. However, if we use a simple key/value dictionary, we can organize records into a very short and compact tree structure without any bloating or excessive memory usage.
Hierarchical Model a part of the product hierarchical explains the product model in the company, you can check thekeepitsimple for elaborated explanations and to read more blogs related to management.
Comments