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 constraints, 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
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.
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.
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 Data 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 Data 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:
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”