Normalization vs Denormalisation of database

Kraiyan
2 min readJul 16, 2024

--

As a Developer, you will come across designing databases which are more or less a topic on their own. So basically when designing a database we need to clear our approach to creating a database(It can be either normalized form or denormalized form of database).In this blog, we will learn about which design should we approach and what are the pros and cons of normalized as well as denormalized databases.

Photo by Mikhail Fesenko on Unsplash

So in normalized databases, we tackle the problem of redundant data in our database. A normalized database is very efficient for cutting off the redundant data which is repeated. It is done by using primary key and foreign key relations within the two separate data tables. If you have written SQL queries in the past, you might be familiar with the join keyword. We use this join keyword to retrieve data from multiple tables by joining them on specific columns that are the same on both tables.

Select  S.studentName, s.studentAge from Student s inner join on s.id= studentClass.student_id where studentClass.class= "History";

In this example, I have demonstrated how you can avoid storing redundant data of classes that one student might take in his School by storing it in two separate tables and not just adding more columns to the student Table.

But having said that,Normalized databases have their own set of consequences. Such as the reading efficiency of a normalized database is far less than that of a denormalized database as we use the join keyword ti which is time-consuming. If we want our system to be time efficient and time complexity is a major priority of the system then we should go with the denormalized databases which will include redundant data as well

In denormalized databases, we let the data be added in a redundant form. This means most of the data related to a particular entity will be stored in the same table contrary to the normalized database approach. This improves the readability of data to a great extent but our concern of data redundancy prevails in this situation.

In conclusion, We can say that depending on our use cases we can decide whether to use normalization for data integrity, reduced redundancy, or denormalization for better readability and overall efficiency of our system.

--

--