Data Modelling

Data Modelling

ยท

3 min read

If you are a Database Developer or Database Engineer you must have heard or faced a scenario where we need to create a model for our database. So, This article is also about Data Modelling or in simple terms how we create data models for our database. The process of creating a model in order to provide consistency, security, data quality, semantics, constraints, default values, etc.... in our database is called Data Modelling. It's a complete process where we provide conceptual representation for data objects and their relation between other data objects and the rules.

Why Data Models?

  1. Ensure data consistency, accuracy, and security, and emphasize more how data will be organized.
  2. Helps in defining entities, relationships between entities, and their attributes.
  3. Relationship between each entity i.e, one to one, one to many, or many to many.
  4. Helps in defining key foreign key, primary key, or unique key.
  5. Helps in identifying data duplicacy and missing data.

Types of Data Models

There are three types of Data Models:

  1. Physical Data Model
  2. Conceptual Data Model
  3. Logical Data Model

In order to understand these models let's divide each one of them into three subparts: (i) Focus Area (ii) Created By
(iii) Purpose

Physical Model: 1) Focus Area: How the physical model will be implemented using a specific DBMS system. 2) Created by: DBA and developers. 3) Purpose: Database implementation.

Conceptual Model: 1) Focus Area: How the conceptual model will be implemented regardless of the DBMS system. 2) Created by: Data Architects and Business Analyst. 3) Purpose: Database designing and defining rules.

Logical Model: 1) Focus Area: Logical Models defines What the system contains. 2) Created by: Business stakeholders and Data Architects. 3) Purpose: Database Organize, Database Scope, and Business rules and concepts.

In order to understand these models practically let's consider a real-world example. We have student and department entities:

Conceptual Data Model:

Screen Shot 2022-07-17 at 12.37.23 AM.png

This defines the conceptual model defining entities and their attributes and the relationship between the entities.

Logical Model:

Screen Shot 2022-07-17 at 12.47.16 AM.png

This defines the logical model. Providing a more logical to the conceptual data model. Defining the data types for the attributes, normalization till 3NF, etc...

Physical Model:

Screen Shot 2022-07-17 at 1.01.05 AM.png

This defines the Physical Model. One of the base models where we define database constraints such as unique key, primary key, and foreign key, indexes, views, default values, etc...

Advantages of Data Models:

  1. Data with accuracy, quality, consistency, etc...
  2. Clear visual for the database.

Disadvantages of Data Models:

  1. Small change in the structure requires entire application changes.

Thanks for the read๐Ÿ™‚Do clap๐Ÿ‘๐Ÿ‘๐Ÿ‘ if find it useful. "Keep learning and keep sharing knowledge"

ย