Chapter 5 of 10All chapters
Chapter 5 of 10
Normalisation
Each fact in exactly one place.
The idea
Normalising means splitting data so no fact is stored twice. If a customer's address appears on every order, changing it means updating rows you will inevitably miss.
- Third normal form is the practical target for most systems.
- The test is simple: could two copies of this fact ever disagree?
Denormalising deliberately
Duplication is sometimes worth it for read speed, such as storing an order total rather than recomputing it. Do it knowingly, after measuring, and write down how the copy stays correct.