Loading learning content...
In the 1960s, as organizations began computerizing their data management, two competing paradigms emerged for structuring database systems. IBM's IMS championed the hierarchical model, organizing data as trees with strict parent-child relationships. GE's IDS and the subsequent CODASYL standard developed the network model, allowing more flexible graph structures.
These weren't academic differences—they represented fundamentally different philosophies about how data should be organized and accessed. For nearly two decades, organizations made strategic bets on one paradigm or the other, building massive applications that would run for decades.
Understanding the comparison between these models isn't merely historical interest. It illuminates the nature of data modeling trade-offs that persist today: simplicity versus flexibility, performance versus generality, and the eternal tension between constraint and expressiveness.
By the end of this page, you will understand: (1) The fundamental structural differences between trees and graphs, (2) How each model handles different relationship types (1:1, 1:N, M:N), (3) Performance characteristics and when each model excels, (4) Data redundancy implications, (5) The programming complexity of each approach, (6) Why both ultimately gave way to the relational model.
The most fundamental difference lies in the underlying graph structures:
Hierarchical Model (Tree Structure):
Network Model (Graph Structure):
| Property | Hierarchical (Tree) | Network (Graph) |
|---|---|---|
| Mathematical structure | Rooted tree (arborescence) | Directed graph (may have cycles) |
| Parent count per node | Exactly 1 (except root: 0) | 0, 1, or many (via different sets) |
| Paths between nodes | Exactly 1 | Potentially many |
| Root requirement | Mandatory—one per hierarchy | None—any record can be an entry point |
| Relationship cardinality | 1:N only (implicit) | 1:N per set, M:N via intersection records |
| Navigation direction | Primarily parent→child | Any direction: owner→member, member→owner, across sets |
The hierarchical model's single-parent constraint is both its defining characteristic and its primary limitation. It simplifies navigation (there's only one path to any record from the root), but it cannot naturally represent real-world scenarios where an entity 'belongs to' multiple parents.
The most significant practical difference between the models is how they handle various relationship types.
One-to-One (1:1) Relationships:
Both models handle 1:1 relationships adequately:
One-to-Many (1:N) Relationships:
Both models excel at 1:N—this is their natural structure:
Many-to-Many (M:N) Relationships:
This is where the models diverge dramatically.
The hierarchical model cannot directly represent M:N. Workarounds include:
Virtual Pairing: Create intersection segments under each parent (data duplication)
Logical Pointers: Store key values that reference records elsewhere (loses navigational performance)
Hierarchy Duplication: Repeat entire hierarchies from different perspectives
All workarounds have significant drawbacks.
The network model handles M:N naturally:
Intersection Records: Create a record type that is a member of sets from both parents
Dual Ownership: The intersection record has two owners via different sets
No Duplication: Each entity appears once; relationships connect them
M:N is expressed without data redundancy.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
/* ================================================================ EXAMPLE: Students enrolled in Courses (M:N Relationship) - Each student can enroll in many courses - Each course can have many enrolled students ================================================================ */ /* HIERARCHICAL MODEL APPROACH */ Database Schema (IMS-style): COURSE (root) └── ENROLLMENT (child with pointer to STUDENT) Contains: STUDENT-KEY (logical child pointer) STUDENT (separate root in another hierarchy) └── S-ENROLLMENT (virtual segment) Physical twin of ENROLLMENT under COURSE /* Problems: - ENROLLMENT data may be duplicated - Must maintain both paths in sync - Queries from student perspective require different access path - Complex pointer management */ /* NETWORK MODEL APPROACH */ COURSE ──[COURSE_ENROLLMENT SET]──> ENROLLMENT STUDENT ──[STUDENT_ENROLLMENT SET]──> ENROLLMENT ENROLLMENT is a member of TWO sets: - COURSE_ENROLLMENT: owned by COURSE - STUDENT_ENROLLMENT: owned by STUDENT /* Benefits: - Single ENROLLMENT record per student-course pair - Navigate from COURSE through ENROLLMENT to retrieve students - Navigate from STUDENT through ENROLLMENT to retrieve courses - No data duplication - Pointer chains maintained by DBMS */ /* Navigation from COURSE to get all enrolled STUDENTS: */ FIND ANY COURSE USING CourseCode = "CS101".FIND FIRST ENROLLMENT WITHIN COURSE_ENROLLMENT.PERFORM UNTIL end-of-set -- Navigate via other set to get student FIND OWNER WITHIN STUDENT_ENROLLMENT. GET STUDENT. DISPLAY StudentName. -- Return and continue FIND NEXT ENROLLMENT WITHIN COURSE_ENROLLMENT.END-PERFORM.IBM enhanced IMS with 'logical relationships' to address M:N limitations. These allowed segments to have 'logical parents' in addition to their physical parent. While this extended capabilities, it added complexity and still required careful design to avoid data inconsistency. The network model's approach was inherently cleaner for M:N scenarios.
The structural constraints of each model have profound implications for data redundancy and consistency maintenance.
Hierarchical Model Redundancy:
Because each record can have only one parent, data that belongs to multiple contexts must often be duplicated:
1234567891011121314151617181920212223242526
/* Example: Supplier information in a manufacturing database */ /* Hierarchical approach - redundancy required: */ HIERARCHY 1: PRODUCT-focused PRODUCT └── PRODUCT_COMPONENT └── COMPONENT_SUPPLIER // Contains supplier details - SupplierName - SupplierAddress - SupplierRating HIERARCHY 2: SUPPLIER-focused SUPPLIER // Full supplier record └── SUPPLIER_PRODUCT // Products they supply /* Problem: If Supplier "Acme Corp" supplies 50 products, their name/address/rating appears in: - Once in SUPPLIER hierarchy - 50 times in COMPONENT_SUPPLIER segments under each product If Acme Corp moves to a new address: - Must update SUPPLIER record: 1 update - Must update 50 COMPONENT_SUPPLIER records: 50 updates - Risk: Updates may be missed → data inconsistency*/Network Model: Reduced Redundancy
The network model's ability to share records across multiple owners eliminates most structural redundancy:
123456789101112131415161718192021222324252627
/* Network approach - no redundancy: */ SUPPLIER record (stored ONCE): - SupplierID - SupplierName - SupplierAddress - SupplierRating PRODUCT record (stored ONCE): - ProductID - ProductName SUPPLY record (intersection, one per relationship): - Member of SUPPLIER_SUPPLY set (owner: SUPPLIER) - Member of PRODUCT_SUPPLY set (owner: PRODUCT) - Contains: Price, LeadTime, Quantity available /* If Supplier "Acme Corp" supplies 50 products: - 1 SUPPLIER record for Acme Corp - 50 SUPPLY records linking Acme to products - Supplier details appear ONCE If Acme Corp moves to a new address: - Update 1 SUPPLIER record - All 50 product relationships automatically reflect correct info - No risk of inconsistency*/| Factor | Hierarchical Impact | Network Impact |
|---|---|---|
| Storage efficiency | Lower—duplicated data consumes space | Higher—shared records, less duplication |
| Update operations | Multiple updates for one logical change | Single update propagates via pointers |
| Consistency risk | High—missed updates cause inconsistency | Low—one source of truth |
| Delete complexity | Must delete all copies | Delete once, set membership removed |
| Application burden | Must coordinate multi-point updates | DBMS maintains relationship integrity |
Both models deliver excellent performance for their intended workloads, but their performance profiles differ significantly.
Hierarchical Model Performance Advantages:
Simpler Navigation: Only one path exists from root to any record. No ambiguity, no choice overhead.
Physical Clustering: Related segments can be stored contiguously on disk (adjacent in a HIDAM or HDAM structure), improving I/O for tree traversals.
Predictable Access Patterns: Top-down access aligns with physical storage, yielding consistent performance.
Less Pointer Overhead: Each record has only one parent pointer (or implicit adjacency), reducing storage overhead.
1234567891011121314151617181920212223242526
/* Hierarchical performance scenario: Bill of Materials */ /* Navigate from Product to all components (tree traversal) */ Product: "Bicycle" ├── Component: "Frame" │ ├── Subcomponent: "Steel Tube" │ └── Subcomponent: "Welded Joint" ├── Component: "Wheels" │ ├── Subcomponent: "Tire" │ └── Subcomponent: "Rim" └── Component: "Handlebars" /* Access Pattern: GU (Get Unique) PRODUCT WHERE ProductID = 'Bicycle' GNP (Get Next within Parent) to iterate children Physical Storage: All segments stored contiguously I/O Pattern: Sequential read through related data Performance: Excellent - minimal disk seeks This is the IDEAL use case for hierarchical: - True tree structure - Access always from root downward - Components genuinely "belong" to products*/Network Model Performance Advantages:
Multiple Access Paths: Can reach data from any direction; application chooses optimal path for each query.
M:N Traversal Efficiency: Following pointers through intersection records is faster than IMS logical relationships.
Bidirectional Navigation: Can traverse from member to owner without searching; owner pointer is explicit.
Set Indexing: Some implementations allow indexed access within sets, further optimizing member lookup.
1234567891011121314151617181920212223
/* Network performance scenario: Multi-path queries */ /* Query: Find all projects for employee E1001 */ -- Path 1: Start from EmployeeFIND ANY EMPLOYEE USING EmployeeID = "E1001". -- O(1) via CALCFIND FIRST ASSIGNMENT WITHIN EMP_ASSIGNMENTS.PERFORM navigate through assignments to get projects... /* Query: Find all employees on project P100 */ -- Path 2: Start from Project FIND ANY PROJECT USING ProjectCode = "P100". -- O(1) via CALCFIND FIRST ASSIGNMENT WITHIN PROJECT_ASSIGNMENTS.PERFORM navigate through assignments to get employees... /* Both queries are efficient! The same ASSIGNMENT records are accessed via different sets. No duplication, no complex logical relationships. In hierarchical model, one direction would be fast, the other would require searching or secondary indexes.*/| Access Pattern | Hierarchical | Network |
|---|---|---|
| Root-to-leaf traversal | Excellent (optimal case) | Good |
| Leaf-to-root navigation | Poor (requires search or secondary access) | Excellent (follow owner pointer) |
| M:N traversal | Poor (complex logical relationships) | Excellent (direct pointer chains) |
| Multi-path queries | Difficult (may need separate hierarchies) | Natural (navigate via different sets) |
| Sequential scan of type | Good (segment type search) | Good (system-owned sets) |
| Storage overhead | Lower (simpler pointers) | Higher (multiple set pointers per record) |
Both models require explicit navigational programming, but the complexity differs based on structural characteristics.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
/* ================================================================ SAME QUERY: List all employees in department "Engineering" ================================================================ */ /* IMS HIERARCHICAL (DL/I calls): */ MOVE 'ENGINEERING' TO DEPT-NAME-SSA.CALL 'CBLTDLI' USING GU, PCB, DEPT-IO-AREA, DEPT-SSA.IF STATUS-CODE = SPACES CALL 'CBLTDLI' USING GNP, PCB, EMP-IO-AREA. PERFORM UNTIL STATUS-CODE = 'GE' -- No more children DISPLAY EMP-NAME CALL 'CBLTDLI' USING GNP, PCB, EMP-IO-AREA END-PERFORM.END-IF. /* Explanation: - GU: Get Unique root segment matching SSA - GNP: Get Next segment within Parent - 'GE' status: End of parent's children - Navigation is strictly parent→child*/ /* CODASYL NETWORK: */ FIND ANY DEPARTMENT USING DeptName = "ENGINEERING".IF DB-STATUS = "0000000" FIND FIRST EMPLOYEE WITHIN DEPT_EMPLOYEE. PERFORM UNTIL DB-STATUS = "0502100" -- End of set GET EMPLOYEE. DISPLAY EMP-NAME IN EMPLOYEE. FIND NEXT EMPLOYEE WITHIN DEPT_EMPLOYEE. END-PERFORM.END-IF. /* Explanation: - FIND ANY: Direct access via CALC key - FIND FIRST/NEXT: Set traversal - GET: Retrieve data (separate from FIND) - Can navigate any direction from here*/ /* Complexity comparison for THIS query: - Both are fairly straightforward - IMS is slightly more compact (combined search arguments) - CODASYL has clearer separation of FIND vs GET - Similar cognitive load for simple hierarchy traversal*/Where Complexity Diverges:
For simple hierarchical queries, both models are manageable. The differences emerge with:
M:N Relationships: CODASYL handles naturally; IMS requires complex logical relationship programming
Multi-directional Queries: CODASYL navigates freely; IMS requires separate access paths or secondary processing
Currency Management: CODASYL's multiple currency types require more careful state management than IMS's simpler parent-child position
Schema Evolution: Changing structure in IMS often requires application rewrites; CODASYL set changes can sometimes be isolated
Both models required programmers to understand database structure intimately and code explicit navigation. Both had steep learning curves. The key difference: IMS was simpler for pure hierarchical data, while CODASYL was more capable for complex relationships. Neither approached the ease of SQL declarative queries.
Each model aligns better with certain data patterns and application requirements.
Hierarchical Model Ideal Use Cases:
Network Model Ideal Use Cases:
| Criterion | Choose Hierarchical If... | Choose Network If... |
|---|---|---|
| Relationships | Purely 1:N, strict containment | M:N or bidirectional access needed |
| Access patterns | Always root-to-leaf | Multiple entry points, varied directions |
| Data redundancy | Acceptable (or natural) | Must be minimized |
| Query flexibility | Predictable, tree-matching queries | Ad-hoc traversal patterns |
| Development team | Familiar with IMS patterns | Need CODASYL relationship flexibility |
| Legacy integration | Existing IMS infrastructure | CODASYL-based systems in place |
In practice, most real-world domains combine hierarchical and network patterns. An organization might have a true hierarchy (org chart) plus many-to-many relationships (employees on projects). This forced organizations to either accept limitations or maintain hybrid approaches—contributing to the appeal of the more flexible relational model.
The competition between hierarchical and network models shaped the database industry for two decades before both were largely superseded by the relational model.
Timeline of Dominance:
| Era | Dominant Models | Key Developments |
|---|---|---|
| 1960-1965 | File systems, early experiments | IDS at GE, GUAM at IBM (IMS precursor) |
| 1965-1970 | Hierarchical emergence | IMS released (1968), CODASYL DBTG formed (1967) |
| 1970-1975 | Peak navigational era | CODASYL report (1971), Codd's relational papers (1970) |
| 1975-1980 | Coexistence | IDMS, IDS/II flourish; System R, INGRES prove relational |
| 1980-1985 | Relational rise | Oracle, DB2 gain enterprise adoption; SQL standardized |
| 1985-1995 | Relational dominance | RDBMS become default; hierarchical/network in maintenance |
| 1995-present | Post-relational diversification | Object, NoSQL, graph databases; IMS and IDMS surviving in legacy |
Why the Relational Model Won:
Both hierarchical and network models lost market dominance to the relational model for several key reasons:
Data Independence: Relational databases separate logical structure from physical storage and from application logic. Programs don't encode navigation paths.
Declarative Queries: SQL specifies what data is needed, not how to retrieve it. The optimizer handles access paths.
Ad-Hoc Query Capability: Business users can write SQL queries without programmer intervention. Both IMS DL/I and CODASYL DML require programming.
Schema Flexibility: Adding an index or changing storage structure doesn't require application changes. Navigational models embedded structure in programs.
Vendor Competition: Multiple relational vendors (Oracle, IBM DB2, SQL Server, Informix) drove innovation and lowered costs. IMS was IBM-only; CODASYL implementations fragmented.
Despite losing market share decades ago, IMS and IDMS systems still run in production at major corporations and government agencies. Migration costs and risks often outweigh benefits for stable, high-volume transaction systems. Some banks process millions of transactions daily on IMS databases designed in the 1970s.
The hierarchical and network models represent two valid approaches to structuring databases, each with distinct strengths and limitations shaped by their fundamental architectural decisions.
Module Conclusion:
With this comparison, we complete our exploration of the network data model. We've traveled from fundamental graph structure concepts through CODASYL standardization, set relationship semantics, navigational programming patterns, and finally this comparison with the hierarchical approach.
The network model represented a significant advancement in data modeling capability—freeing designers from the rigid tree structure to represent complex real-world relationships naturally. Its influence persists in modern graph databases that once again embrace explicit relationship modeling and navigational queries, albeit with more user-friendly interfaces.
Understanding these historical models provides perspective on database design trade-offs that remain relevant: simplicity versus expressiveness, performance versus flexibility, and the eternal question of how much control to give programmers versus how much to abstract into the system.
You have completed Module 3: Network Model. You now understand graph structure fundamentals, CODASYL standardization, set relationship semantics, navigational programming, and how the network model compares to its hierarchical predecessor. This knowledge provides essential context for understanding database evolution and the design principles that shape modern systems.