Data Models
A data model is a collection of high-level data description constructs that hide many low-level storage details. A DBMS allows a user to define the data to be stored in terms of a data model.
The data models can be classified into different categories:
- Hierarchical Model
- Network Model
- Entity-Relationship Model
- Relational Model
- Object-Based Data Model
- Semi-structured Data model
1. Hierarchical Model
Hierarchical Model was the first DBMS model. This model organises the data in the hierarchical tree structure.
The hierarchy starts from the root which has root data and then it expands in the form of a tree adding child node to the parent node. This model easily represents some of the real-world relationships like food recipes, sitemap of a website etc.
Depicts a set of one-to-many (1:M) relationships
Disadvantages of the hierarchical model:
- easy to design at the same time it is quite complex to implement.
- This model also lacks flexibility as the changes in the new tables or segments often yield very complex system management tasks. Here, a deletion of one segment can lead to the involuntary deletion of all segments under it.
2. Network Model
This model is an extension of the hierarchical model, the only difference is that a record can have more than one parent. It replaces the hierarchical tree with a graph.
The network model was created to represent complex data relationships more effectively when compared to hierarchical models, to improve database performance and standards.
Depicts both one-to-many (1:M) and many-to-many (M:N) relationships.
Disadvantages of the Network Model:
- Database contains a complex array of pointers.
- System complexity limits efficiency.
- Structural changes require changes in all application programs.
- Navigation systems yield complex implementation and management.
- Keep heavy pressure on programmers due to the complex structure.
- Any change like updating, deletion, insertion is very complex.
3. Entity-Relationship Model
An ER model is the logical representation of data as objects and relationships among them. These objects are known as entities, and relationship is an association among these entities.
Entity-Relationship Model Components
ER diagram basically having three components:
- Entities − It is a real-world thing which can be a person, place, or even a concept. For Example: Department, Admin, Courses, Teachers, Students, Building, etc are some of the entities of a School Management System.
- Attributes − An entity which contains a real-world property called an attribute. For Example: The entity employee has the property like employee id, salary, age, etc.
- Relationship − Relationship tells how two attributes are related. For Example: Employee works for a department.
An entity has a real-world property called attribute and these attributes are defined by a set of values called domain.
Advantages of Entity-Relationship Model
- The ER model is easy to build.
- This model is widely used by database designers for communicating their ideas.
- This model can easily convert to any other model like network model, hierarchical model etc.
- It is integrated with the dominant relational model.
Disadvantages of Entity-Relationship Model
- There is no industry standard for developing an ER model.
- Information might be lost or hidden in the ER model.
- There is no Data Manipulation
- There is limited relationship representation.
4. Relational Model
The relational model uses a collection of tables to represent both data and the relationships. Tables are also known as relations. Each table has multiple columns represent as attributes, Attributes are the properties which define a relation. Each row of the table represents as Tuple, Tuple is one piece of information.
Terminologies used in Realation Model
- Tables: relations are saved in the table format. A table has two properties rows and columns
- Attribute: columns represent as attributes
- Tuple: A Row represent as Tuple
- Relation Schema: A relation schema represents the name of the relation with its attributes.
- Degree: The total number of attributes which in the relation is called the degree of the relation.
- Cardinality: Total number of rows present in the Table.
- Column: The column represents the set of values for a specific attribute.
- Relation instance: The set of tuples of a relation at a particular instance of time is called as relation instance.
Advantages of Realation Model
- Structural Independence: Structural independence is an ability that allows us to make changes in one database structure without affecting other. The relational model have structural independence. Hence making required changes in the database is convenient in relational database model.
- Conceptual Simplicity: The relational model allows the designer to simply focus on logical design and not on physical design. Hence relational models are conceptually simple to understand.
- Query Capability: Using simple query language (such as SQL) user can get information from the database or designer can manipulate the database structure.
- Easy design,maintenance and usage: The relational models can be designed logically hence they are easy to maintain and use.
Disadvantages of Realation Model
- Relational model requires powerful hardware and large data storage devices.
- May lead to slower processing time.
- Poorly designed systems lead to poor implementation of database systems.
5. Object-Based Data Model
The complex real world problems are represented as objects with different attributes. In Object Oriented Data Model, data and their relationships are contained in a single structure which is referred as object. All objects have multiple relationships between them. Basically, it is combination of Object Oriented programming and Relational Database Model.
Components of Object Oriented Data Model
- Objects: An object is an abstraction of a real world entity or we can say it is an instance of class. Objects encapsulates data and code into a single unit which provide data abstraction by hiding the implementation details from the user.
- Attribute: An attribute describes the properties of object.
- Methods: Method represents the behavior of an object, it represents the real-world action
- Class: A class is a collection of similar objects with shared structure i.e. attributes and behavior.
- Inheritance: new classes are created from the existing classes
Advantages of Object-Based Data Model
- Reduced Maintenance
- Real-World Modeling
- Improved Reliability and Flexibility
- High Code Reusability
Disadvantages of Object-Based Data Model
- It is a complex navigational system.
- Slow development of standards.
- High system overheads.
- Slow transactions.
6. Semi-structured Data model
The semi-structured data model permits the specification of data where individual data items of same type may have different sets of attributes. The Extensible Markup Language (XML) is widely used to represent semistructured data model.
Advantages of Semi-structured Data Model
- Data is not constrained by fixed schema.
- It is flexible.
- It is portable.
Disadvantage of Semi-structured Data Model
- Queries are less efficient than other types of data model.
Next Topic :Levels of Abstraction in DBMS