Normalization & Denormalization
Someone asked me about this basic thing which we generally do not think much, so realize that should write a short blog on it.
For any database the way data is stored using different data models of database design is called normalization. More normalize the data would be eliminate redundancy (filtered).
There are different types of normal forms, depending upon how much filter are you looking for.
First Normal Form:
This is the basic one, which makes database row uniqueness by including PRIMARY KEY.
Second Normal Form:
Here it works on columns and introduces FOREIGN KEY.
Third Normal Form:
Including 1st and 2nd Normal form, it makes sure that only related data would be exists(depends upon KEY).
- The more normalize the data more tables(objects) and relationship between them requires which is good for data distribution
- including indexes on them will fast up the data retrievals.
- this is good for OLTP environment which has more data movements.
- Requires more Joins to retrieve data.
Denormalization: opposite to normalization, it is good for OLAP system where less writes more reads.