Principle and application of database--hierarchical and network model of data model

Source: Internet
Author: User

2018-01-22 20:55:42

First, hierarchical model

The first data model appears because many of the data in the real world itself has hierarchical relationships, and the hierarchical model describes the objective world as a tree structure .

The IMS (Information Management Systems) database management system, introduced by IBM in 1968, is the first hierarchical model database management system and the most typical one.

1. Record and fields (field)

A record is a named unit of data used to describe a relationship between a thing or a thing. It contains several fields, each of which is also named, and the fields can only be simple data types, such as shaping, string types, and so on.

The left image is a record named department, which has 4 fields, which is the definition of record type, that is, the recorded data pattern; the right is an example of a record.

2. Relationship between parents and children (Parent-child RELATIONSHIP,PCR)

This is the most basic data data relationship in a hierarchical model. It represents a one-to-many relationship between two record types.

3. Hierarchical data Schema (hierarchical)

The hierarchical data pattern contains multiple PCR relationships.

The left image is an example of a hierarchical data pattern in which each box represents a record type, and each arc represents a PCR type. The hierarchical data pattern should be a tree, so there is only one parent for each record type, but there can be multiple children.

The graph on the right is an instance of the hierarchical data pattern, which can have multiple instances that form a forest.

4. Virtual record

In the real world, most of the time is not just a one-to-many relationship, that is, there may be many-to-many, many-to-one, ternary relations and so on, so the hierarchical data model must be extended to simulate non-hierarchical data to have universal significance.

In order to avoid redundancy, the concept of virtual records is introduced to solve the problem, so-called Virtual records, which is essentially a pointer, that is, where the record should be stored in place of a pointer instead.

Second, mesh data model

The mesh data model and the hierarchical data model are similar to the records (record) as the data storage units, the records contain a number of items (data items), where the data items are more powerful than the field, the field can only be a simple data type, data items can be complex data types (arrays, other records, etc.). In a mesh data type, each record entry can be a master record for more than one record, or it can be a genus of multiple master records. In addition, the mesh data model introduces contact records (link record) to address self-linking, multivariate, etc.

1. System (SET)

The mesh data model uses a system to denote a one-to-many relationship between records, with fewer parties called Master records, and many known as genera Records. The mesh data model is stored in the form of a linked list in the computer.

We see that whether it is a hierarchical data model or a mesh data model, you need to manually write your own programs when querying, such as the hierarchical data model needs to traverse the tree, and the mesh data model needs to traverse the linked list.

Principle and application of database--hierarchical and network model of data model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.