What is denormalization and when is it used?
Answer
Denormalization is the intentional introduction of redundancy into a normalized schema to improve read performance. Examples: storing a pre-calculated order_total in the orders table (instead of summing line items each query), duplicating a user's name in a comments table (avoiding a JOIN), or maintaining a posts_count column on the users table. Denormalization trades write complexity (maintaining consistency of duplicated data) for faster reads and fewer JOINs. It is commonly used in: read-heavy applications, data warehouses/OLAP, caching layers, and document databases. Always normalize first, then denormalize specific bottlenecks based on profiling.
Previous
What are database anomalies and how does normalization prevent them?
Next
What are isolation levels in database transactions?
More Database Design / Normalization Questions
View all →- Intermediate What are database anomalies and how does normalization prevent them?
- Intermediate What are isolation levels in database transactions?
- Intermediate What are dirty reads, non-repeatable reads, and phantom reads?
- Intermediate What is query optimization and what is a query execution plan?
- Intermediate What is a covering index?