What is database normalisation, and when should you denormalise?
Normalisation organises data so that each fact is stored exactly once, eliminating redundancy and the update anomalies that come with it. Denormalisation deliberately reintroduces redundancy to make reads faster, accepting the cost that creates.
What redundancy actually costs. If a customer's address is stored on every order, changing it means updating many rows — and any missed row creates a contradiction with no way to tell which is correct. These are called update, insertion and deletion anomalies, and avoiding them is the whole point.
The normal forms, informally:
First normal form — no repeating groups; each column holds a single value.
Second normal form — no partial dependency on part of a composite key.
Third normal form — no non-key column depending on another non-key column. The commonly repeated summary is that every non-key attribute depends on the key, the whole key, and nothing but the key.
Higher forms exist and are rarely the deciding factor in practice; 3NF is where most schemas should start.
When denormalisation is justified:
Read-heavy workloads where joins are genuinely the bottleneck — and this must be measured, not assumed.
Aggregates that are expensive to compute, stored as counters or summary rows.
Analytical schemas, where star and snowflake designs are deliberately denormalised because the workload is reads over large scans.
Immutable historical records. An invoice should record the price and address as they were, not join to current values — which looks like denormalisation and is actually correct modelling, because the historical fact is genuinely different data.
Distributed systems, where joins across nodes are expensive.
What denormalisation costs, and this is where it goes wrong:
Every copy must be kept in sync, and that responsibility moves from the database to your application code.
Writes become more expensive, sometimes dramatically.
Bugs produce inconsistent data that is hard to detect and harder to repair.
The sensible order: normalise first, measure, then denormalise specifically where evidence demands it — and document why.