Data Models | Record based data model - relational , hierarchical and network | Object based data model - Object oriented , ER model | Physical Data Model | Conceptual Data Model

 


Data Model


A data model is a model that defines in which format the data are represented and accessed. Data model mainly defines some of the data elements and relationships that exist between them.


Data modeling is the process of creating a data model for the data to be stored in a database. This data model is a conceptual representation of Data objects, the associations between different data objects, and the rules. Data modeling helps in the visual representation of data and enforces business rules, regulatory compliances, and government policies on the data. Data Models ensure consistency in naming conventions, default values, semantics, security while ensuring quality of the data.




Types of Data Model



There are basically two types of data model:

  1. Record based data model
  2. Object based data model




1) Record based data model




When the database is organized in some fixed format of records of several than the model is called record-based data model.

A fixed number of fields, or attributes in each record type and each field is usually of a fixed length. The three most popular record-based data models are .


Relational data model


The relational data model uses tables to represent the data and the relationships among these data. Each table has multiple columns and each column is identified by a unique name. It is a low-level model.



Relational data model

                                Figure - Relational data model



In this model, data is organized in two-dimensional tables and the relationship is maintained by storing a common field.


This model was introduced by E.F Codd in 1970, and since then it has been the most widely used database model, in fact , we can say the only database model used around the world.


The basic structure of data in the relational model is tables. All the information related to a particular type is stored in rows of that table.


Hence, tables are also known as relations in relational model.



Advantages of relational data model

  • It is the simplest model at the conceptual level.
  • The relational data model makes it easy to design, implement, maintain, uses the database.
  • It does not affect the DBMS’s capability to access the data.
  • The main reason for the popularity of relational model is the presence of powerful query capability.



Network data model


In the network data model, data model data are represented by collections of records. Relationships among data are represented by links. In this data model, graph data structure is used. It permits a record to have more than one parent.


Network data model


                                    Figure - Network Data model



This is an extension of the Hierarchical model. In this model data is organized more like a graph, and are allowed to have more than one parent node.

In this database model data is more related as more relationships are established in this database model. Also, as the data is more related, hence accessing the data is also easier and fast. This database model was used to map many-to-many data relationships.



Advantages of Network data model

  • The Network data model is also conceptually simple and easy to design.
  • In the network data model relationships like one-to-one and many-to-many are exist.
  • In the network data model without the owner, no member exists.
  • In the network database terminology, a relationship is a set. Each set comprises two types of record an owner record and a member record.


Hierarchical data model



In the hierarchical data, model data are represented by collections of records. Relationships among data are represented by links. In this model, tree data structure is used. There are two concepts associated with the hierarchical model segments types and parent-child relationships.


Hierarchical data model


                                Figure - Hierarchical Data model



This database model organizes data into a tree-like-structure, with a single root, to which all the other data is linked. The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes.


In this model, a child node will only have a single parent node.

This model efficiently describes many real-world relationships like index of a book, recipes etc.

In hierarchical model, data is organized into tree-like structure with one one-to-many relationship between two different types of data, for example, one department can have many courses, many professors and of-course many students.



Advantages of Hierarchical data model

  • Since the database is based on the hierarchical structure the relationships between the various layers are logically simple.
  • The hierarchical data model was the first database that offered the data security that is provided by DBMS.
  • The Hierarchical database model is based on the parent-child relationships.
  • It is very efficient one when the database contains a large number of one-to-many relationships.




Object based data model



In the object-based data model, the database is organized in real-world objects of several types. A number of fields or attributes are defined in each object. The two most popular object-based data models are:

  • Object Oriented model
  • ER model

 

Imagine we have to design database for college. What is the real world entities involved with college? They are college, Students, Lecturer, Course, Subject, Marks etc. Once all the entities are listed, we find out the relationship between them and try to map all of them. 

Also we list what are the attributes related to each entity like student id, name, lecturer name, course that he is teaching, different subjects, pass mark, grade levels etc. 

Here we are not bothered about what data value is stored, what is the size of each data etc. We know only entities involved, their attributes and mapping at this stage.

Object based Data Models are based on above concept. It is designed using the entities in the real world, attributes of each entity and their relationship. It picks up each thing/object in the real world which is involved in the requirement.




Object oriented model



The object-oriented model is based on a collection of objects. An object contains values stored in instances variable within the object. An object contains bodies of code that operate on the object.

This data model is another method of representing real world objects. It considers each object in the world as objects and isolates it from each other. It groups its related functionalities together and allows inheriting its functionality to other related sub-groups.

Let us consider an Employee database to understand this model better. In this database we have different types of employees – Engineer, Accountant, Manager, Clark. But all these employees belong to Person group. Person can have different attributes like name, address, age and phone. What do we do if we want to get a person’s address and phone number? We write two separate procedure sp_getAddress and sp_getPhone.


Advantages of object oriented data model


  • It represents relationships explicitly supporting both navigated and associative access to information.
  • Object-oriented database systems are not suited for all applications.
  • It is difficult to maintain when organizational information changes.
  • Because of its inheritance property, we can re-use the attributes and functionalities. It reduces the cost of maintaining the same data multiple times. Also, these informations are encapsulated and, there is no fear being misused by other objects. If we need any new feature we can easily add new class inherited from parent class and adds new features. Hence it reduces the overhead and maintenance costs.
  • Because of the above feature, it becomes more flexible in the case of any changes.
  • Codes are re-used because of inheritance.
  • Since each class binds its attributes and its functionality, it is same as representing the real world object. We can see each object as a real entity. Hence it is more understandable.

Disadvantages

  • It is not widely developed and complete to use it in the database systems. Hence it is not accepted by the users.
  • It is an approach for solving the requirement. It is not a technology. Hence it fails to put it in the database management systems.



ER (Entity Relational model)


The entity relational data model based on the perception of the real world that consist of a collection of basics objects and relationships between them. It is an object-based logical model. It is also high-level data model.


ER (Entity Relational model)


                                      Figure - Entity Relationship model



In the below diagram, Entities or real world objects are represented in a rectangular box. Their attributes are represented in ovals. Primary keys of entities are underlined. All the entities are mapped using diamonds. This is one of the methods of representing ER model. There are many different forms of representation. More details of this model are described in ER data model article.

ER (Entity Relational model)

                                        ER Model


Basically, ER model is a graphical representation of real world objects with their attributes and relationship. It makes the system easily understandable. This model is considered as a top down approach of designing a requirement.


Advantages

  • It makes the requirement simple and easily understandable by representing simple diagrams.
  • One can covert ER diagrams into record based data model easily.
  • Easy to understand ER diagrams

Disadvantages

  • No standard notations are available for ER diagram. There is great flexibility in the notation. It’s all depends upon the designer, how he draws it.
  • It is meant for high level designs. We cannot simplify for low level design like coding.



  1. Conceptual Data Model: This Data Model defines WHAT the system contains. This model is typically created by Business stakeholders and Data Architects. The purpose is to organize, scope and define business concepts and rules.
  2. Logical Data Model: Defines HOW the system should be implemented regardless of the DBMS. This model is typically created by Data Architects and Business Analysts. The purpose is to developed technical map of rules and data structures.
  3. Physical Data Model: This Data Model describes HOW the system will be implemented using a specific DBMS system. This model is typically created by DBA and developers. The purpose is actual implementation of the database.



Conceptual Data Model


Conceptual Data Model is an organized view of database concepts and their relationships. The purpose of creating a conceptual data model is to establish entities, their attributes, and relationships. In this data modeling level, there is hardly any detail available on the actual database structure. Business stakeholders and data architects typically create a conceptual data model.

The 3 basic tenants of Conceptual Data Model are

  • Entity: A real-world thing
  • Attribute: Characteristics or properties of an entity
  • Relationship: Dependency or association between two entities

Data model example:

  • Customer and Product are two entities. Customer number and name are attributes of the Customer entity
  • Product name and price are attributes of product entity
  • Sale is the relationship between the customer and product

Conceptual Data Model


Conceptual Data Model


Characteristics of a conceptual data model

  • Offers Organization-wide coverage of the business concepts.
  • This type of Data Models are designed and developed for a business audience.
  • The conceptual model is developed independently of hardware specifications like data storage capacity, location or software specifications like DBMS vendor and technology. The focus is to represent data as a user will see it in the "real world."

Conceptual data models known as Domain models create a common vocabulary for all stakeholders by establishing basic concepts and scope.



Logical Data Model



The Logical Data Model is used to define the structure of data elements and to set relationships between them. The logical data model adds further information to the conceptual data model elements. 

The advantage of using a Logical data model is to provide a foundation to form the base for the Physical model. However, the modeling structure remains generic.



Logical Data Model


Logical Data Model


At this Data Modeling level, no primary or secondary key is defined. At this Data modeling level, you need to verify and adjust the connector details that were set earlier for relationships.

Characteristics of a Logical data model

  • Describes data needs for a single project but could integrate with other logical data models based on the scope of the project.
  • Designed and developed independently from the DBMS.
  • Data attributes will have datatypes with exact precisions and length.
  • Normalization processes to the model is applied typically till 3NF.

Physical Data Model



Physical Data Model describes a database-specific implementation of the data model. It offers database abstraction and helps generate the schema. This is because of the richness of meta-data offered by a Physical Data Model. 

The physical data model also helps in visualizing database structure by replicating database column keys, constraints, indexes, triggers, and other RDBMS features.



Physical Data Model


Physical Data Model

Characteristics of a physical data model:

  • The physical data model describes data need for a single project or application though it maybe integrated with other physical data models based on project scope.
  • Data Model contains relationships between tables that which addresses cardinality and nullability of the relationships.
  • Developed for a specific version of a DBMS, location, data storage or technology to be used in the project.
  • Columns should have exact datatypes, lengths assigned and default values.
  • Primary and Foreign keys, views, indexes, access profiles, and authorizations, etc. are defined.

Advantages and Disadvantages of Data Model:



Advantages of Data model:

  • The main goal of a designing data model is to make certain that data objects offered by the functional team are represented accurately.
  • The data model should be detailed enough to be used for building the physical database.
  • The information in the data model can be used for defining the relationship between tables, primary and foreign keys, and stored procedures.
  • Data Model helps business to communicate the within and across organizations.
  • Data model helps to documents data mappings in ETL process
  • Help to recognize correct sources of data to populate the model

Disadvantages of Data model:

  • To develop Data model one should know physical data stored characteristics.
  • This is a navigational system produces complex application development, management. Thus, it requires a knowledge of the biographical truth.
  • Even smaller change made in structure require modification in the entire application.
  • There is no set data manipulation language in DBMS.


Comments

Popular posts from this blog

Limitations of the File-Based Approach

The Three-Level ANSI-SPARC Architecture

Roles of DA , DBA , Database Designer , Application Developers and Users