Normalization organizes data into related tables so each fact is stored once and linked by keys. This reduces anomalies and keeps updates consistent across operational workflows.
- Separate entities such as customers, products, and orders into distinct tables.
- Use primary and foreign keys to enforce relationships.
- Balance normalization with query patterns and reporting needs.
Why normalization matters in operations
Northstar initially kept order and customer details in one wide table. Address changes and customer segment updates caused conflicting values across rows.
Splitting into customers, orders, and order_items reduced duplication and made updates safer because each business fact had one home.
Apply normal forms pragmatically
First normal form removes repeating groups, second normal form removes partial dependency on composite keys, and third normal form removes transitive dependency. These rules help detect risky table designs.
In analytics layers, selective denormalization can be useful, but operational source tables should stay clean first.
- Define natural versus surrogate keys intentionally.
- Use constraints to enforce data quality at write time.
- Document relationship cardinality for future developers.
Refactor duplicated customer attributes
Order rows repeated customer_email and customer_segment, causing inconsistent updates across historical records.
- Create customers table with customer_id as primary key and one row per customer.
- Move customer attributes to customers and keep customer_id on orders as foreign key.
- Validate no orphan orders remain and update downstream joins.
Common mistakes
- Embedding repeated customer fields in every transaction row.
- Skipping foreign key constraints and relying on application code alone.
- Over-normalizing small lookup data without practical benefit.
- Changing key definitions without migration and backfill planning.
Try one
What problem does normalization primarily prevent in transactional systems?
It prevents duplicate fact storage that leads to inconsistent updates, inserts, and deletes across related records.
Sources
- PostgreSQL 18 Docs: Data DefinitionOfficial PostgreSQL DDL concepts, keys, constraints, and table design basics.