What is denormalization, and when would you use it?
MediumConceptNormalization
Answer
Denormalization is the deliberate addition of redundant or precomputed data to a normalized schema to make frequent reads faster, at the cost of extra storage and more complex writes.
- It is used when joins or aggregations on the normalized design are measured to be a bottleneck, typically in read-heavy systems, reports and analytics.
- Techniques include copying a frequently joined column into another table, storing derived values such as an order total, and keeping summary tables or materialized views.
- The risk is inconsistency: if an update misses one copy, the copies disagree, so they are kept in sync with transactions, triggers or background jobs.
- It is not the same as skipping normalization: you normalize first, then denormalize selectively.
Example:
Normalized: orders(id, customer_id) customers(id, name)
Denormalized: orders(id, customer_id, customer_name)
An order list page can now show customer names without a join. However, when a customer changes their name, every one of their orders must be updated too.