How do you balance the trade-offs between normalization and denormalization in database design?

Instruction: Discuss the considerations you make when deciding to normalize or denormalize data in a database.

Context: This question evaluates the candidate's understanding of the benefits and drawbacks of normalization and denormalization, and their ability to make informed decisions based on specific project requirements.

Updated

Official answer

Start with the business dependencies and invariants. A normalized source can keep a customer's current address in one authoritative record, reducing conflicting updates across copies. Normalization by itself does not provide ACID transactions; those depend on the database and how operations use it.

Denormalize a specific read model when the benefit justifies the update and storage cost. For example, a reporting summary may precompute daily totals, while a historical invoice deliberately preserves the address used at purchase. The invoice snapshot has different meaning from a redundant copy of today's address.

For each derived copy, specify its source, refresh delay, rebuild process and how failures or corrections are reconciled. If several records must change together, decide whether a transaction is required or whether an explicitly eventual view is acceptable.

Measure actual queries, write amplification, contention, storage and maintenance. Fewer joins do not guarantee faster reads, and user count alone does not reveal the query mix. Keep correct result semantics and an accountable source of truth while optimizing the demonstrated workload.

Related Questions