Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
when we normalize the database why we need to denormalize?
Posted
Updated 9-Jun-12 17:31pm
v2

Normalization makes sure that the data is not redundant, which is a good thing. But this can be bad as well.

Consider this example. Say there is a database for bank accounts. And imagine that there is a relation (table) for Account, and another relation for Transactions.

We do not need to have an ACCOUNT_BALANCE column, because we can always derive the account balance from summing up the transactions. But...

If we get the account balance in this way, every time the account balance is retrieved, a huge operation is performed on the database. When the number of Account records and Transaction records gets bigger, the computation gets intensive.

That's a good reason to de-normalize the database and have an ACCOUNT_BALANCE column in Account table.

I hope you get the idea.
 
Share this answer
 
Denormalization is an effort to improve the performance of a database. It does not (and should not) seek to eliminate the goal of data integrity, but instead seeks to optimize performance while maintaining data integrity.

This should help:
Understand Normalization Before Denormalizing[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900