Skip to content

Denormalization

In one line

Denormalization is the intentional process of duplicating data across tables to speed up reads by avoiding joins.

In simple words

Denormalization is the opposite of normalization — you deliberately store redundant data to improve read performance. Instead of joining three tables to get a user's order with their city, you store the city name directly in the orders table.

This trades write complexity (you must update the city in every order when it changes) for read speed (no joins needed). It is common in read-heavy systems like analytics dashboards, reporting, and data warehouses.

Denormalization is a deliberate design choice, not an accident. You normalize first to ensure data integrity, then selectively denormalize the hot paths that are read often but updated rarely.

Example

sql
-- Denormalized: store the city name directly in orders
CREATE TABLE orders_denorm (
  id        SERIAL PRIMARY KEY,
  user_name TEXT,
  user_city TEXT,  -- duplicated from cities table
  total     NUMERIC
);
-- Fast reads: no JOIN needed, but city must be updated everywhere if it changes

Storing user_name and user_city directly avoids joins but creates redundancy to maintain.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary