Normalization Example

A database model that implements normal forms avoids those anomalies, and that’s why BCNF or 4NF is recommended. Sometimes, some trade-offs are possible with the normalization process, as in the following example.

Use case: Modeling an address field

Modeling an address field is a practical use case for normalization, where if we want to respect all the rules, we end up with a very complex schema. That said, the answer depends on our application domain; it’s not the same if we’re connecting people to our telecom network, shipping goods, or just invoicing at the given address.

For invoicing, all we need is a text column to store whatever our user is entering. Our only use for that information is going to be for printing invoices, and we’ll be sending the invoice in PDF over email anyway.

Why the address field?

If we’re in the delivery business, we need to ensure the address physically exists and is reachable by our agents, and we might need to optimize delivery routes by packing together goods in the same truck and find the most efficient route in terms of fuel consumption, time spent, and how many packages we can deliver in a single shift.

Get hands-on with 1200+ tech skills courses.