What is normalisation, what are the first three normal forms, and when would you deliberately denormalise?
Normalisation organises a schema so that every fact is stored exactly once, which removes update anomalies.
- First normal form (1NF) — every column holds a single atomic value. No comma-separated lists, no repeating groups like
phone1, phone2, phone3. - Second normal form (2NF) — 1NF, and every non-key column depends on the whole primary key. This only bites with composite keys: if a table keyed on
(order_id, product_id)also storesproduct_name, that column depends on half the key and belongs in the products table. - Third normal form (3NF) — 2NF, and no non-key column depends on another non-key column. Storing
cityandstatealongsidepincodebreaks it, because state is a fact about the pincode, not about the row.
When to denormalise: when a read path is measurably too slow and the join is the proven cause. Typical cases are a cached aggregate such as comment_count on a post, or a reporting table built for one dashboard. The price is that you now own the consistency problem — you must update the copy whenever the source changes, usually in the same transaction or through a scheduled rebuild.





