Network Model:
In Network Model, the data is represented collection of records and relationship among them is represented by link. The links can be thought of as a pointers and the record as arbitrary graphs. Database forms tree likes structure with highest level as root and next levels are children. The concept of parent and child is here.
Implementation:
The Network Model is closely tied to the implementation. The Network Model uses the data structure diagram for its representation and link and pointers for its implementation.
Example:
Characteristics of Network Model:
-
Record Structure:
- Data is organized into records, similar to the hierarchical model.
- Records consist of fields or attributes that hold the actual data.
-
Sets and Relationships:
- Data is organized into sets, which are equivalent to tables in the relational model.
- Relationships are established between sets. A set can be related to multiple sets, and vice versa.
-
Hierarchical Structure:
- While the network model allows for more complex relationships, it retains a hierarchical structure. Records are organized in a tree-like structure, and each record can have multiple parent and child records.
-
Many-to-Many Relationships:
- Unlike the hierarchical model, the network model allows for many-to-many relationships between records. This is achieved through the use of sets and pointers.
-
Pointers:
- Pointers are used to represent relationships between records. They provide a way to navigate from one record to another, facilitating traversal through the network.
-
Schema:
- The schema in the network model is described using a schema diagram, which illustrates the structure of the database, including sets, records, and relationships.
-
Data Integrity:
- Like the hierarchical model, the network model enforces data integrity by maintaining relationships between records. Deleting a record may require consideration of its relationships to avoid orphaned records.
-
Complex Queries:
- The network model allows for more complex queries compared to the hierarchical model. Records can be accessed through multiple paths, providing greater flexibility in querying.
-
Efficient Retrieval:
- Retrieval of data can be efficient, especially when navigating along established relationships. This makes it suitable for applications where data access patterns follow a network-like structure.
Advantages of Network Model:
-
Flexibility:
- The network model is more flexible than the hierarchical model, as it allows for many-to-many relationships between entities. This flexibility makes it easier to represent complex relationships in the data.
-
Efficient for Complex Relationships:
- It is well-suited for representing complex relationships between entities. This is particularly useful when dealing with data that involves intricate connections and dependencies.
-
Data Integrity:
- The network model maintains data integrity by enforcing relationships between entities. Relationships are established through pointers, which helps ensure that data remains consistent.
-
Query Performance:
- Retrieving specific pieces of information from the database can be more efficient in a network model compared to a hierarchical model, especially for complex queries that involve multiple relationships.
Disadvantages of Network Model:
-
Complexity:
- The network model can be complex to design and understand. The implementation of pointers and the interconnected nature of data can make the database schema challenging to manage and maintain.
-
Lack of Standards:
- Unlike the relational model, which has well-defined standards (SQL), the network model lacks standardization. This can lead to variations in implementation and make it challenging for developers to work with databases from different vendors.
-
Programming Complexity:
- Writing queries for a network database can be more complex than for a relational database. Navigational access methods are often required, and users must specify the path to retrieve the desired data, which may be less intuitive than the declarative queries used in relational databases.
-
Scalability Issues:
- As the complexity of relationships increases, the network model may face challenges in terms of scalability. Large and complex databases may become difficult to manage and optimize for performance.
-
Limited Adoption:
- The network model has not gained as much popularity as the relational model. Most modern database systems use the relational model, and there is a wealth of tools, resources, and expertise available for relational databases.