De Normalization
De Normalization
Denormalization?
Denormalization is the
process of intentionally
introducing redundancy into
a database by adding or
combining tables.
It is a trade-off between
performance and data
integrity.
Read
more
Created by
Pranjal Meshram
1.
3.
Created by
Pranjal Meshram
Why do we need to
‘De’ Normalize?
While normalization has many benefits, it also has
some shortcomings, especially in certain use cases:
Performance Overhead: Normalized databases
often require complex queries with multiple joins,
which can slow down read operations.
Increased Complexity: Highly normalized
schemas can be difficult to design, understand,
and maintain. Schema changes can also be more
complicated.
Specialized Use Cases: Normalized databases are
less optimized for scenarios requiring aggregated
data or summary reports, and may not be ideal for
Online Analytical Processing (OLAP) systems.
Created by
Pranjal Meshram
Advantages of
Denormalization
Improved Query Performance: Reducing the
number of joins and pre-computing values can
significantly improve the speed of read
operations.
Simplified Data Retrieval: Queries become
less complex and easier to write and understand.
Enhanced Reporting: Denormalized data can
be more efficient for reporting and analytical
queries, where read performance is critical.
Created by
Pranjal Meshram
Disadvantages of
Denormalization
Increased Data Redundancy: Introducing
redundancy can lead to increased storage
requirements and potential data inconsistency.
Complex Updates: Maintaining data integrity
during updates becomes more complex because
changes must be propagated across multiple
redundant copies of the data.
Potential for Anomalies: Data anomalies such
as update, insert, and delete anomalies can
occur, which normalization aims to prevent.
Created by
Pranjal Meshram
Example
Consider a normalized database with two tables:
Orders and Customers.
OrderID CustomerID OrderDate TotalAmount
john.doe@exa
1 101 John Doe 2023-01-10 100.00
mple.com
Created by
Pranjal Meshram