Skip to content
Contents/CH 06
Modeling/Intermediate · 12 min

Hierarchical Database Model

The hierarchical model is a tree. It is fast when your data is a tree and painful when it is not.

In plain English

It is a family tree: each child has one parent, and you follow the branches down.

The one idea

A hierarchical database stores a tree: one parent, many children, and fast navigation along a known path.

It explains why early databases were fast for bills of materials and awkward for many-to-many relationships. The trade-off still appears in modern document and directory stores.

By the end

  1. 01Explain parent-child records in the hierarchical model.
  2. 02Trace navigational access through a tree.
  3. 03Know why many-to-many relationships are difficult.
  4. 04Identify the strengths and limits of hierarchical databases.
01

Tree-structured records

A hierarchical database stores records in a tree. Each child has exactly one parent, and a parent can have many children. Access starts at the root and follows a path down the tree. This makes one-to-many navigation fast and predictable, but it fixes the access path into the schema.

chapter-06.db
Department
  ├── Employee
  │     ├── Dependent
  │     └── Dependent
  └── Employee
        └── Dependent
02

Navigational access

The program navigates from parent to child using pointers or path names. There is no declarative query optimizer choosing a plan; the application knows the tree. This is efficient for stable, tree-shaped workloads but brittle when requirements change.

03

Limitations

Many-to-many relationships require redundant copies or an artificial hierarchy. A child cannot have two parents without duplicating data. Queries that need a different path may be expensive. The model is historically important and still appears in directories and file systems, but it is not the default for new application data.

Worked example3 steps

A shared part in a bill of materials

An assembly contains subassemblies, and the same bolt is used in two different subassemblies.

01

Store Division → Department → Employee as parent-child segments.

A path query from a division to its employees is direct.

02

Store Assembly → Subassembly → Part.

A part used in two subassemblies must appear twice.

03

Update the bolt's supplier.

Every duplicated copy must be found and changed.

ConclusionThe tree is an excellent index and a poor model for shared ownership. Duplication is the price of keeping one parent.

The trade-off

No free correctness.

Gain

Very fast parent-child navigation and a simple physical layout.

Cost

No direct many-to-many relationships; structural change can require rebuilding the tree.

Verdict

Good for strict hierarchies and path queries; weak when entities have multiple parents.

Recap

What to keep.

Takeaways

  • +Hierarchical databases are trees with one parent per child.
  • +Access is navigational and path-dependent.
  • +One-to-many navigation is fast.
  • +Many-to-many relationships cause redundancy or awkward workarounds.
  • +The model fits directories and stable tree-shaped data.

Traps

  • !Trying to model a many-to-many relationship directly.
  • !Assuming a child can have two parents.
  • !Confusing a hierarchical database with a file directory tree, though the shape is similar.

Focus

  • →Draw a small tree and trace a query path.
  • →Explain why M:N is hard.
  • →Name one modern use of tree-shaped data.

Check yourself

Before you turn the page.

0 / 2 answered
01

How many parents can a record have in a pure hierarchical model?

02

What is the main access method in a hierarchical database?

DB//COSMOS

A field manual for database systems: model the domain, normalize the facts, query the relations, and protect the result.

Edition 2026 · 32 chaptersTopic catalogInterview prep