- Jul 16, 2025
Data Modeling with Relational Databases
- DevTechie Inc
- Data Engineering
Path to Data Engineering — Day 3
If you are following along, on Day 2 we delve into how to make a mark as a new data engineer and how to approach creating a simple data pipeline. On Day 3, we will learn about some beginner’s but important concepts like:
a. Data Modeling — What is Entity Relationship Diagram?
b. What is the difference between conceptual, physical and logical data model and
On Day 4, we will learn about how modern day Data lake came into picture and its difference with Relational Databases.
So let’s get going,
Data Model:
Objects:
Traditional Relational Database systems like Oracle, MySQL, SQL Server, PostgresSQL and many others, stored data in tables with rows and columns/attributes. Tables are also referred to as Entities which represent real world objects like Student, Customers, Inventory etc…
Entity Relationships (1:1, 1:N, M:M):
The relationship between these entities is represented by Entity Relationship Diagram or ERD in short. These relationships can be one-to-one, one-to-many and many-to-many.Example, in a student enrollment system, a student can enroll in any number of courses and a course can have any number of students, signifying many-to-many relationships.
Referential Integrity:
These relationships are maintained via referential integrity which ensures data remains consistent and avoids orphan records. This is implemented using foreign key.
Constraints:
Further, the database design contains the right kind of constraints on the attributes like unique and NOT NULL constraints, right datatypes for the attributes, check and default constraint.
Indexes:
This is important for performance as well, example, if you create a primary key of the table as string or "VARCHAR", say, "VARCHAR(5)", a clustered index would automatically get created on a PK column, since "VARCHAR" takes up more bytes than an integer value your lookup during a join operation would be slow.
ACID Properties:
ACID are four fundamental properties to ensure reliability of database transactions especially in business like Banking applications. A transaction is a sequence of operations treated as a single unit e.g. begin a transaction followed by commit or rollback transaction. ACID. is vital for domains like banking and finance, e-commerce and healthcare.Example, someone withdrawing money from a bank, atomicity would ensure that all operations are completed; if any failure, the entire transaction is rolled back.
In relational databases, the relational data model supports ACID compliance through well-defined transaction management, indexing, constraints, and locking mechanisms. In non-relational systems, certain data models may relax or trade off ACID guarantees (especially Isolation and Consistency) in favor of scalability and availability, as seen in some NoSQL systems. We would take a deeper look into this aspect of modeling on Day 4.
Conceptual, Logical and Physical Design:
When you are a data engineer or an architect responsible for designing a database, these are the 3 design phases you go through, whereby, you start with a conceptual design which would be a high-level, defining entities, relationships, attributes etc…
Conceptual design (“What”):
Here, you can produce ER Diagrams, focus on business requirements and relationships. These steps could be a document and are independent of any particular database system. For example, a customer (PK customerID in customer table) can have any number of orders but an order (with PK OrderID in order table) would belong to exactly one customer, forming a 1:N (one to many) relationship between two entities.
Logical design(“How”):
This step gives the conceptual model a structure that can be implemented. It bridges the gap between business requirements and technical implementation. Here, the table structure will be defined with all attributes/columns, primary and foreign keys, data types, normalizations, constraints on columns etc…
Physical design (“Actual Implementation”):
In this step, logical design gets translated into technology specific implementation. It details what would be the DDL scripts, scripts for indexes, table partitioning schemes, stored procedures, views, DB roles, permissions etc…A through physical design may contain hardware specifications, network diagrams and more.
Conclusion:
Hopefully, this gives an overview as to how to approach data modeling when it concerns RDBMS systems. This would also give some key pointers for acing an interview. Stay tuned! In Day 4 we will explore more about modern day data architecture and creation of data lakes with cloud storage and No-SQL databases. See you then!
Listen to the podcast on Day 3 in Data Engineering