ComputersDatabase

A hierarchical database is ... Models, examples

A hierarchical database is a database based on a tree structure. By the principle of building, it is somewhat similar to the computer's file system. The use of such a model has its advantages and disadvantages, which will be discussed in this article, together with detailed examples.

Types of databases

As you know, there are four types of database construction:

  • Relational tables are DBMS, where information is represented as row-columns. By this principle databases are being built in "Accessory", for example.
  • Object-oriented - are closely related to OOP (programming, which works with objects), and this is their main advantage, but, given their small performance, they are still much inferior to the prevalence of relational.
  • Hybrid - DBMS, containing at once the two above mentioned species.
  • Hierarchical - the object of attention of this article. This DB, characterized by a tree-like structure.

The most famous example of a hierarchical database is a product created by IBM ("IBE"), called the Information Management System (translated as "Management Information System"), abbreviated IMS. The first version of IMS came out in the past, the twentieth century, in the sixty-eighth year. It is used to store and control data to this day.

The principle of constructing a hierarchical model

The hierarchical data model is constructed according to the following principle:

  • For each node of the tree structure, a segment is put in correspondence;
  • The segment is understood as data fields with a name assigned to each field and aligned in one linear tuple;
  • One more match: one input and several output segments for each source field;
  • For each structural element there is one and only one place in the hierarchy system;
  • The tree structure begins with the root element;
  • Each subordinate node has only one ancestor, but each source can have several children.

Applying a hierarchical data structure

A hierarchical database is a repository that is applicable to those systems that are inherently tree-like in structure. For them to choose such a simulation is logical.

An example of a hierarchical database with initially systematized degrees is a military unit, in which, as is known, ranks are clearly defined. Also, it can be complex mechanisms, consisting of ever more simplified to the bottom hierarchy of particles. To model such systems and bring them to the form of the database under consideration, there is no need for decomposition. Nevertheless, this situation does not always evolve.

In addition, there is a trend in which the downward-directed query is simpler than the similar one up.

Basic operations on databases built on a hierarchical model

The structure of the hierarchical database allows you to successfully and practically problem-free (depending on skills and abilities) to perform the following operations (the most basic ones are listed, you can always expand the list with small additions):

  • Search the database of an item;
  • Go to the database - from tree to tree;
  • Crossing the tree - from branch to branch;
  • Accordingly, the transition along the branches is element-by-element;
  • Work with records: inserting a new one and / or deleting the current one, copying, cutting, etc.

Generalized structure description

The term "tree" for describing the structure is mentioned in this article already many times. It's time to tell where he came from. All because the hierarchical database is a database that uses the data type "tree". Let us consider in more detail what he is like.

This is a composite type: each of the elements (nodes) is embedded several subsequent (one or more). And everything starts from one root element. The bottom line is that each of the pieces of the "tree" type is a subtype, also a "tree". Many, many branched, and all-ordered structures.

Elementary types can be simple and complex, but in essence they are always records. But in a simple record, there is one type of data, and in the composite one there is a whole set of data.

Hierarchical model inherent in the principle of descendants, when each previous segment is an ancestor for the next. In addition, the descendant with respect to the superior type is a subordinate type, while the equivalent records are considered to be twins.

Filling the database

The main data of the hierarchical database are the values (numbers or symbols) that are stored in the records. Bypass such a database usually from the bottom up and from left to right.

Advantages

A hierarchical database is the root folder of the database, gradually branching downwards. Given that this structure is very similar to the file system, such databases are successfully used to perform various operations on computer data. Outcome: the rational distribution of its memory, as well as very worthy indicators of time spent on work.

The hierarchical model is ideal for applying it for orderly information.

disadvantages

However, the same features of the DBMS under consideration, which have become their main advantages, also determine their shortcomings. For example, the bulkiness and complexity of logical connections - an experienced specialist when working with a previously unknown database will be difficult to understand, and a simple user and at all in it "get lost". This complexity of understanding leads to the fact that in fact not so many DBMS are built on a hierarchical model. An example of a hierarchical database is, in addition to the already described product of the company "IBE", "Oka" and MIRIS (Russia), as well as Data Edge and Team-UP (from foreign corporations).

Examples

A hierarchical database is the variety of different levels on which interconnections are built. Schematically it looks like an inverted graph. An example of a hierarchical database is any state administrative institution. Take, say, a school.

At the highest level will be located "leader" of the administration - director. In his subordination, the head teachers, the head teachers - teachers who direct the parallels of classes. In each parallel there is a certain number of them, and in each class there is a certain number of students.

By the same principle, you can paint and manage a corporation. The head of the company or even the board of directors at the top. Further - an increasing number of units, in each of which operates its own structure. There are also common features: the chief in each department, his assistant, his secretary, actually, office employees and so on.

Application in the COMPUTER

There may be more serious applications. A vivid example of a hierarchical database is the file system. Everyone familiar "Explorer" is built in the very core of the operating system "Vindous" is precisely this scheme, as well as many other file managers.

Network databases

Exist:

  • Relational;
  • Hierarchical;
  • Network databases.

Why did we again remember the classification? Since, unlike a relational database, the network database has a hierarchical similarity.

Time to remember the types of links in the databases. There are one-to-one, one-to-many, and many-to-many relationships. We are interested in the latter. In a network DB, it manifests as follows: one node-heir can have several ancestors at once. The property of having several children is also preserved. We can say that hierarchical databases, network databases themselves are an example of such inheritance. Ancestor in this case is the hierarchical database, since the principle of constructing the structure in network databases remains the same.

Hierarchy and relationality

The name "relational" came from the English word "attitude". As mentioned at the beginning of the article, they are often expressed in tabular form. But in the previous paragraph, we indicated that a hierarchical database can also organize links, does this mean that there is a certain thin thread connecting them between these two types?

Yes. In addition to the fact that both the first and the second view are still related to databases, there is one more common property besides this feature. For example, a hierarchical database (and network with it) can be expressed in a table. The point here is not how to present the information to the end user (this is already a question of usability of the interface), but by what principle the information was structured. So, a clear division into divisions with their bosses, divisions and the rest will still be expressed in the hierarchy, but for convenience is listed in the table.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.