Database Management System (DBMS) / Types of Databases

Hierarchical Databases

A Hierarchical Database is a type of database that organizes data in a tree-like structure.

Each record (node) has one parent and can have many children, forming a parent-child relationship — much like a family tree or file system.

➡️ It follows a 1-to-many (one-to-many) relationship.


📁 Structure Example

Company (Root)
├── Department 1
│   ├── Employee A
│   └── Employee B
├── Department 2
│   └── Employee C

Here:

  • "Company" is the root node

  • "Department" is the parent

  • "Employee" is the child


🧠 Key Concepts

Concept

Description

Root

Top-most parent node

Parent Node

A node that has children

Child Node

A node that belongs to one parent

Hierarchy

The path from root to any node

1:N Relationship

One parent can have many children, but each child has only one parent


✅ Advantages

Advantage

Description

⚡ Fast data access

Excellent performance for hierarchical queries

📐 Data integrity enforced

Enforces strict parent-child relationships

🔐 Simplicity

Easy to understand and visualize

📊 Good for structured data

Works well where data has a clear hierarchy (e.g., org charts)


❌ Disadvantages

Disadvantage

Description

❌ Rigid structure

Difficult to change structure without affecting the whole tree

❌ No many-to-many support

Can’t model complex relationships easily

❌ Data redundancy

Same data might appear in multiple places

❌ Difficult navigation

Querying across different branches is complex


🧰 Examples of Hierarchical Databases

Database

Description

IBM IMS (Information Management System)

One of the earliest hierarchical DBMS

Windows Registry

Stores OS configuration in a tree-like format

LDAP (Lightweight Directory Access Protocol)

Hierarchical directory service

XML Files

Structured hierarchically, often used in config and web data


📍 Use Cases

Use Case

Why Hierarchical DB is Good

🏢 Organization charts

Employees, departments, branches

📁 File systems

Folders, subfolders, files

🔐 User permissions

Roles and nested access levels

🛠️ Network directories

Like LDAP and Active Directory


🆚 Comparison with Other Models

Feature

Hierarchical DB

Relational DB

NoSQL DB

Structure

Tree (parent-child)

Tables (rows/columns)

Flexible (JSON, graph, etc.)

Relationships

One-to-many

Many-to-many supported

Flexible (depends on type)

Flexibility

Low

Moderate

High

Query Language

Proprietary/Navigational

SQL

Varies

Use Case Fit

Well-structured hierarchies

General-purpose

Big Data, flexible schema