.NET Architecture & System Design Interview Question #64

What is denormalization?

Database Scaling, Partitioning, NoSQL & Data Consistency Mid-Level Intermediate

Quick Interview Answer

Denormalization intentionally duplicates or pre-combines data to make important reads faster or simpler. Examples include storing calculated totals, maintaining read models, or embedding commonly displayed values.

Detailed Explanation

Denormalization intentionally duplicates or pre-combines data to make important reads faster or simpler. Examples include storing calculated totals, maintaining read models, or embedding commonly displayed values.

The cost is additional storage and synchronization logic. When duplicated data changes, the system must define how and when copies are updated and what level of temporary inconsistency is acceptable.

Code Example

Normalized:
Order -> Customer -> Address

Denormalized read model:
OrderSummary
- OrderId
- CustomerName
- City
- Total