Skip to content
Commitwise
Menu

Denormalization

Copying or precomputing data on purpose, usually to make reads cheaper.

Definition

Examples are storing an order's total next to its items, a product's review count, or a read-optimized table built from events. Every copy needs one mechanism that keeps it in sync (the same transaction, a trigger, a materialized view, an event consumer). Historical values, like the price actually paid, are not denormalization: they are different facts.

In practice

orders.total is updated in the same transaction as order_items, so the order list doesn't sum items for every row.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.