bigonotes
System DesignData Modeling

Normal Forms and Denormalization

Why you store each fact once by default, what 1NF, 2NF and 3NF mean, and when duplicating data for faster reads is worth it.

5 min readLast updated

Normalization keeps every fact in a single home. A customer's city is stored once, in customers, and every other table points to it by key. That prevents update anomalies, where a change lands in one place but not another. Denormalization deliberately copies data to make reads faster, and takes on the job of keeping the copies in sync. Most schema decisions sit somewhere between the two, so it helps to know both well.

Side by side#

The difference is easiest to see with one small shop stored both ways.

Normalized: customers and orders in separate tables, linked by customer_id.

id name city
31 Maya Lisbon
32 Tomás Porto
id customer_id (FK) total placed_at
9001 31 42.50 2025-03-14 09:12
9002 31 18.00 2025-03-20 17:40

Denormalized: the customer's name and city copied onto every order.

id customer_id name city total placed_at
9001 31 Maya Lisbon 42.50 2025-03-14 09:12
9002 31 Maya Lisbon 18.00 2025-03-20 17:40

The denormalized table can show an order list without a join. But when Maya moves to Berlin, every order she has ever placed must be updated. Miss one and the data disagrees with itself.

The normal forms#

So how do you know a schema is normalized? You check it in steps called normal forms. Each form fixes one kind of duplication, and each builds on the one before. In practice, "normalized" usually means third normal form (3NF).

First normal form (1NF): one value per cell#

A table is in 1NF when every cell holds a single, atomic value and there are no repeating groups of columns.

This customers table breaks 1NF in two ways: a list in one cell, and numbered columns for the same thing.

customer_id name phones phone1 phone2
1 Alice 555-0100, 555-0101 555-0100 555-0101

The fix is a separate table with one row per phone number:

customer_id phone
1 555-0100
1 555-0101

Now you can index, search and add phone numbers without changing the schema.

Second normal form (2NF): depend on the whole key#

A table is in 2NF when it is in 1NF and every non-key column depends on the whole primary key. This only matters when the key has more than one column.

Here the key is (student_id, course_id), one row per student per course:

student_id course_id student_name grade
7 CS101 Priya A
7 CS202 Priya B

grade depends on both the student and the course. But student_name depends only on student_id, which is part of the key. So the name repeats for every course Priya takes. The fix moves it to a students table (student_id, student_name) and leaves enrollments with (student_id, course_id, grade).

Third normal form (3NF): no facts about other facts#

A table is in 3NF when it is in 2NF and no non-key column depends on another non-key column. That chain is called a transitive dependency.

Here the key is employee_id, one row per employee:

employee_id name department_id department_name manager
101 Sam 10 Payments Lee
102 Ana 10 Payments Lee

department_name and manager depend on department_id, not on the employee. If Payments gets a new manager, you must update every employee row. The fix splits the table:

  • employees (employee_id, name, department_id)
  • departments (department_id, department_name, manager)

Here are the three forms in one place:

Form Rule Breaks it Fix
1NF One atomic value per cell; no repeating groups phones list, phone1/phone2 A child table, one row per value
2NF Non-key columns depend on the whole key student_name keyed by part of (student_id, course_id) Move to a table keyed by student_id
3NF Non-key columns depend only on the key manager depends on department_id Move to a departments table

Higher forms exist, such as Boyce-Codd normal form (BCNF) and 4NF. They handle rarer cases, and most designs stop at 3NF.

Are normalized writes faster?#

With the forms in hand, a common claim is easier to check. You often read that normalized schemas have faster writes. That's only partly true.

  • Updating a shared fact is cheaper. A manager change touches one departments row instead of every employee row. This is the real win.
  • Creating one record can cost more. Saving one order in a normalized schema may insert into orders, order_items and addresses, each with its own indexes and foreign key checks. A denormalized design might write a single row or document.
  • Index and constraint costs add up. More tables usually mean more indexes and more foreign key checks on each insert.

So normalization makes updates safe and cheap for shared facts, and keeps them consistent. It does not make every write faster. Measure the write path that matters to you.

Default to normalized#

Given those trade-offs, the safe starting point is clear. Model the data normalized first. Copy data only for a particular read path that has proven too slow. Duplicated data wastes space and creates consistency problems that are usually harder to fix than the performance problem you were trying to avoid.

When denormalization makes sense#

Denormalizing is still the right call sometimes. Copying data pays off in a few specific situations:

  • Analytics and reporting, where you aggregate data that rarely changes.
  • Event logs and audit trails, where you want a snapshot of the data as it was at that moment.
  • Heavily read-optimized systems like search indexes, where speed matters more than perfect consistency.
  • Precomputed counters, like products.review_count, derived from a normalized reviews table.

You can often get denormalized reads without denormalizing your database. Put a cache in front that holds a precomputed shape of the data (pre-joined rows, aggregates). The source of truth stays clean and normalized, and the cache makes reads fast.

Key takeaways#

  • Normalized: each fact stored once, cheap and safe updates to shared facts, no update anomalies. Inserting one record may still touch several tables.
  • 1NF: one value per cell. 2NF: depend on the whole key. 3NF: depend only on the key.
  • Denormalized: copies for fast reads, but every change must update every copy.
  • Start normalized and denormalize a specific read path only when you need to.
  • A cache or derived table can give you denormalized reads while the source of truth stays normalized.
Revision notes · 2 min

Core idea#

Normalization stores each fact in exactly one place, which prevents update anomalies. Denormalization copies data for faster reads and takes on the job of keeping the copies in sync.

Key points#

  • Normalized: a customer's city lives only in customers. Orders link to it by customer_id.
  • Denormalized: customer fields are copied onto every order. A move to a new city must update every order.
  • Start normalized. Denormalize only when a specific read path needs it.
  • Duplicated data wastes space. Its consistency problems are often harder to fix than the speed problem.
  • A cache or derived table can give denormalized reads while the source of truth stays normalized.

Normal forms#

Form Rule Example violation
1NF One atomic value per cell; no repeating groups phones list, phone1/phone2
2NF Non-key columns depend on the whole key student_name in enrollments
3NF Non-key columns depend only on the key manager depends on department_id
  • Most designs stop at 3NF. BCNF and 4NF handle rarer cases.
  • Normalized updates to a shared fact are cheap and safe. Inserting one record can still touch several tables, indexes and foreign keys.

When denormalization makes sense#

Case Why
Analytics and reporting Aggregates over data that rarely changes
Event logs, audit trails You want a snapshot as it was then
Read-optimized systems, search Speed matters more than perfect consistency
Precomputed counters products.review_count derived from reviews

Pitfalls#

  • Missing one copy on update leaves the data inconsistent.
  • Denormalizing up front, before any read path needs it.
  • Assuming normalized writes are always faster. Measure the write path.

Say it in an interview#

  • "Normalized by default. A cache holds the pre-joined shape for the hot read path."

Found a mistake? Email ask@bigonotes.com