Interview › Databases & Caching
What is database normalisation, and when would you denormalise?
Databases & Caching · Intermediate level
Answer
Normalization reduces duplication and update anomalies by modeling entities in separate related tables. Denormalization intentionally duplicates or precomputes data for read performance, but it adds consistency and reconciliation work.
Technical explanation
Normalization reduces duplicated facts and prevents update anomalies.
Denormalization improves specific reads but creates consistency and reconciliation work.
The normalized OLTP schema can remain source of truth while read models, materialized views, or caches serve optimized reads.
Hands-on example
Example denormalization:
orders(customer_id) references customers(id).
Add orders.customer_name_at_purchase for immutable order history.
Backfill:
UPDATE orders o SET customer_name_at_purchase = c.name FROM customers c WHERE c.id = o.customer_id;Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- What is a deadlock, and how do databases detect and resolve them?
- What is a transaction, and what do the ACID properties mean?
- What is WAL (write-ahead logging), and how does it support durability and replication?
- What is a composite index, and does column order matter?
- What is AWS DMS, and when would you use it?
- How do you decide which columns to index?
- What is schema migration, and how do you run migrations safely in production?
- What is connection exhaustion, and how do you prevent it?