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?
- Ensure data consistency, accuracy, and security, and emphasize more how data will be organized.
- Helps in defining entities, relationships between entities, and their attributes.
- Relationship between each entity i.e, one to one, one to many, or many to many.
- Helps in defining key foreign key, primary key, or unique key.
- Helps in identifying data duplicacy and missing data.
Types of Data Models
There are three types of Data Models:
- Physical Data Model
- Conceptual Data Model
- 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:
This defines the conceptual model defining entities and their attributes and the relationship between the entities.
Logical Model:
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:
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:
- Data with accuracy, quality, consistency, etc...
- Clear visual for the database.
Disadvantages of Data Models:
- 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"