0% found this document useful (0 votes)
15 views19 pages

5 Denormalization

Denormalization is a database strategy aimed at improving performance by adding redundant data to a normalized database, which can reduce the complexity of queries that require data from multiple tables. While normalization minimizes redundancy and ensures data consistency, it can lead to inefficiencies in data retrieval, especially as the volume of data grows. A balanced approach may involve maintaining both normalized and denormalized data structures to optimize performance and organization.

Uploaded by

kifayetali070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views19 pages

5 Denormalization

Denormalization is a database strategy aimed at improving performance by adding redundant data to a normalized database, which can reduce the complexity of queries that require data from multiple tables. While normalization minimizes redundancy and ensures data consistency, it can lead to inefficiencies in data retrieval, especially as the volume of data grows. A balanced approach may involve maintaining both normalized and denormalized data structures to optimize performance and organization.

Uploaded by

kifayetali070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

5

DENORMALIZATION OF
DATABASE TABLES

1
5

NORMALIZATION – KEY POINTS


The main purpose of having clear design and
normalization of tables is to
 Reduce redundancy
 Consistent data in the database.
Hence we will have multiple tables in the
database and each will be mapped with one
another by referential integrity.
 To retrieve data, join of related tables is done.
2
5

WHAT IS DENORMALIZATION??
Denormalization is a strategy that
database managers use to increase the
performance of a database
infrastructure.
It involves adding redundant data to a
normalized database to reduce certain
types of problems with database
queries that combine data from various
tables into a single table.

3
5

NORMALIZATION – Example

4
5
NORMALIZATION – Example

5
5
DENORMALIZATION – Example

6
5

Why would anyone Denormalize


a Database ????

7
5

Why Denormalization is Done


When amount of data in database grows then
• The cost of the data retrieval query will
increase drastically.
This is because, it will have to join multiple
tables to get the data and these tables are
not smaller.

8
5
Why Denormalization is Done
• As a thumb rule of database design, we should
have normalized data so that there should not
be any redundancy. But this normalization
increases the cost of performance.
• Comparing the good design and performance
of database, performance takes the priority.
• Any user accessing the database is more
interested in quick and correct result than how
a database is designed.

9
5
How to Denormalize a Database??
• Denormalization disregards the rules of
normalization it will absolutely lead to
redundant data and duplicated columns.
• Denormalization means joining data from two
or more normalized tables this data can then
be inserted into a single table. this is often
referred to as flattening
• The flatten data will usually be redundant
data

10
5
Why would you ever create
redundant data??
• With denormalization there is a trade-off between
data being flattened and performance
Normalized data can take less space and increase
performance
• However it will require data to be joined
• Joins across tables needs significantly more
overhead within a Database server
“ The More joins involved in a query the more
resources will be needed to retrieve the data “
11
5
Example
• Let’s take an example of Grocery store..
• You want to buy ingredients for three meals of
the day.

Breakfast Lunch Dinner

Omlete Meat Balls Pizza


Tea Russian Salad Spaghetti

12
5
Example
• Data Retrieval in Normalized Situation

• Data is organized section wise and shopping is


done section wise as well.
13
5
Example

Data Retrieval in Denormalized Situation


• Data is organized by meals
perspective
• Shopping this way will take
only few minutes
• From the stores perspective
this would be a horrible way
to keep things organized
and it wouldn't help all
shoppers
14
5

Normalization vs Denormalization

• Normalization is high on the organization


scale but can lead to inefficiencies in
retrieving data
• Denormalization leads to highly efficient and
fast data retrieval but it leads to redundant
data

15
5
How to balance tradeoff between
Normalization & Denormalization
One way to balance this trade-off is to look for
the best of both worlds
• it may make sense to store your data in both
normalized relational tables and in
denormalized flatten table

16
5
How to balance tradeoff between
Normalization & Denormalization
 Let’s take example of Movie Rental Store
We might consider keeping two versions of the
data
• Normalized relational tables to complete
transactions
• A separate flattened version for reporting

17
5
How to balance tradeoff between
Normalization & Denormalization

18
5
How to balance tradeoff between
Normalization & Denormalization

19

You might also like