Data Models in DBMS
Data models are the models explaining the logical structure of the database systems. They describe the entities, attributes, and the relationship among the data elements of the specified database.
Data models organize the description and consistency constraints of the data. After the complete implementation of the database, these models show how the data is represented to each other and how they are stored, accessed, and updated inside the database systems.
Various types of data models in the database management system (DBMS) are as follows:
- Flat Data Model
- Hierarchical Model
- Relational Model
- Entity-Relationship Model
- Object-Oriented Data Model
- Object-Relational Data Model
- Network Model
Flat Data Model
The flat Data Model is a model which kept all the data in the same plane. It is a first and foremost introduced traditional data model, which is not much scientific.
In this model, the database is indicated as a single table in the form of tuples (rows) and fields (columns). This DBMS data model is slow and inefficient process.
Hierarchical Data Model
The hierarchical model is that data model which indicates the data of the database in the tree-like structure. This is the first database management system model.
This data model stores the data as records and connects them through links. Each hierarchical data model has a single parent entity for each record. A parent can have more than one child node, and all the siblings are sorted in a specific order.
In the 60s and 70s, this data model was mainly used by the Information Management System (IMS) of IBM.
In this hierarchical tree structure, only one entity is present at the top, which is called a root entity. If any database user wants to read the data from the hierarchical database, then that user has to traverse the tree from the root node to the data node.
Advantages of Hierarchical Data Model
Following are the few benefits or advantages of the Hierarchical data model:
- This database model has a parent-child relationship, so it is simple to use and understand.
- This data model easily manages a huge amount of data and describes the connection between the information.
- The referential Integrity of this model is always automatically maintained.
- The data and the information presenting at the top of the tree is very fast to access.
- Users can easily add and delete new information in this model.
Disadvantages of Hierarchical Data Model
Few disadvantages of the Hierarchical data model in the database are as follows:
- As the users require the physical identification of the database, so it is complex.
- This model does not support complex (multi-parent) relationships.
- The flexibility of the hierarchical data model is poor.
- There is a lack of data independence.
- One of the biggest disadvantages of this model is that if any user deleted the record of the parent node, then the child node is automatically removed or deleted.
- When the user wants to access the data from the lower entities at that time speed of the database is very slow.
Network Data Model
The network data model is that model which denotes the data of the database as the graph. It is a simple model for indicating the objects and their relationships.
This data model was originally introduced by Charles Bachman.
Before the invention of the relational model, this was the most popular database model.
Sometimes, this model is also known as the CODASYL model because it was adopted in 1969 by the CODASYL Data Base Task Group. In this data model, data and information are more connected to each other. Due to the high-bonding, any user can access data easily and fastly.
This model is mainly used to denote the many-to-many relationship between the given data.
Advantages of Network Data Model
Following are the few benefits or advantages of the network data model in the DBMS:
- Users can easily design and understand this data model.
- As compared to the hierarchical model, users can access the data at fast speed.
- Users can easily search the information due to its flexibility.
- The biggest advantage of this data model is that it can easily handle one to many, many to one and many-to-many relationships.
Disadvantages of Network Data Model
Some limitations or disadvantages of the network data model are as follows:
- One of the main disadvantages of this model is its complexity. It is so complex because the pointers maintain each record. And, the pointers make the database more complex.
- Insertion, updation, and deletion operations are complex because of the large number of pointers.
- It is very difficult in the network data model to make the structural changes to the database.
Relational Data Model
The relational data model is a data model indicating the structure of the database in the 2-D (2-dimensional) tables. In this model, all the data or information given by the user is stored in the table rows according to the specific column.
Edgar Frank Codd (E.F. Codd) was a great scientist who invented the relational model for the databases in 1970.
In the relational model, tables are called relations, and rows and columns are called tuples and attributes.
The following example consists of a relation (table) whose name is Employee. This Employee table contains five attributes (columns) and six tuples (rows).
Five attributes of this table are Employee_ID, Employee_Name, employee_Age, Employee_Salary, and Dept_ID.
|Employee_ID||Employee_ Name||Employee_Age||Employee_ Salary||Dept_ID|
Advantages of the Relational Data Model
The advantages of the relational data model are as follows:
- As compared to the hierarchical and network data model, the relational data model is simpler for the users to use and understand.
- The relational data model easily supports the topic of data integrity.
- Any database user can easily implement and design the relational data model in the database and stores the data at a fast speed.
- The main benefit of this model is that it abstracts the details of physical storage from the database users and developers.
Disadvantages of the Relational Data Model
Some disadvantages or limitations of the relational data model are as follows:
- The cost of the relational data model is so high. Huge money is required for maintaining the relational data model. So, it is one of its big disadvantages.
- Relational data models can’t store a huge amount of data in their databases.
- Trained, skilled, and experienced database administrators are required for maintaining the databases.
Entity-Relationship Data Model
Entity-Relationship Model is that model which helps in designing the structure of the database conceptually or logically. It is a high-level data model, which is developed by Peter Chen in the year of 1976. Any developer can easily understand the database system by the ER diagram. ER diagram is a tool which consists of various symbols for representing the ER model.
It is a best data model for designing a database. After designing the database, we can easily convert the designed ER diagram into the tables of the relational model.
ER model of DBMS consists of the following three components:
In the following example, the Employee and Department are the two entities. The attributes of the Employee entity are Emp_ID, Emp_Name, Emp_Salary, and Emp_Age. And, the attributes of the Department entity are Dept_ID and Dept_name. These two entities are connected by a relationship, whose name is Works_In.
Advantages of Entity-Relationship Data Model
Some benefits or advantages of the Entity-Relationship data model are as follows:
- If any user knows the relationship between the entities, then he/she can easily and fastly develop and maintain the ER model. So, this model is very easy to set up and develop.
- This data model can be easily converted by the developers into other data models without any problem.
- This tool is so effective for communication between the designers.
Disadvantages of Entity-Relationship Data Model
Some benefits or disadvantages of the Entity-Relationship data model are as follows:
- As compared to other data models, it denotes fewer relationships.
- In this data model, there are more chances that some details of data might be lost or hidden.
Object-Oriented Data Model
The object-Oriented data model is that model representing the data and relationship as the object. This model stores the videos, audios, and graphical files which can’t be stored in the relationship model.
This model is based on the three main components whose names are object class, object identity, and object structure. This data model is mainly designed for storing and retrieving the objects which are created by the programs of object-oriented languages. It also provides the facilities of object-oriented to the database users.
Advantages of Object-Oriented Data Model
Some benefits or advantages of the object-oriented data model are as follows:
- This data model saves and stores the complex data sets fastly and easily.
- This data model is best for object-oriented programming languages.
- It is applicable for advanced database applications like CAD, CASE, OIS, etc.
- This data model uses different protocols for handling and managing the long-duration transactions.
- As compared to the network, hierarchical, and relational data model, this model can store different types of data.
Disadvantages of Object-Oriented Data Model
Some limitations or disadvantages of the object-oriented data model are as follows:
- As the complexity of this model is increased due to the increased functionality provided by it.
- The main disadvantage of this model is that it does not provide security mechanisms for the stored data and information.
- Due to the high complexity, the performance of this data model is not good in some conditions.
Object-Relational Data Model
The object-Relational data model is that model which combines the relational model with the advanced functions of the object-oriented data model.
The main objective of this model is to connect the gap between the techniques of the object-oriented data model and relational model, which are used in C++ and Java programming languages. This model supports the table structure as well as the concepts (objects, classes, and inheritance) of the object-oriented model. Due to the high complexity, we have a need to understand this model properly.
This data model helps database developers by increasing the abstraction of the data.
Advantages of Object-Relational Data Model
Some benefits or advantages of the object-relational data model are as follows:
- The first and main advantage of this data model is that it increases the productivity for the database developer as well as end-users.
- This model allows its database users to inherit the objects and tables for extending the functionality.
- Unlike the relational data model, this model allows the users to use the inheritance.
Disadvantages of Object-Relational Data Model
Some limitations or disadvantages of the object-relational data model are as follows:
- The main limitation of this data model is that it is hard to handle and manage.
- As compared to other traditional data models, the complexity of the object-oriented relational model is so high.