StoicBuilder

HandbookXI the TabulariumNormalisation

XIthe Tabularium, Model the data

Normalisation

1 min readUpdated 28 November

In plain words

Normalisation means storing each fact in exactly one place, in its own table, and pointing to it by id, so changing it once changes it everywhere and copies can't drift apart.

Where you see it

Harbor's first schema copied the team name onto every member row. A customer renamed their team, and half the screens kept showing the old name. With the name stored only in teams, every screen reads the same value.

Before and afterdatabase
-- before: the team's details copied onto every member rowteam_members(id, user_id, team_name, team_plan) -- after: the team's details live once, in teamsteams(id, name, plan_id)team_members(id, user_id, team_id references teams(id))
Rename a team once in teams, and every screen that joins to it shows the new name.

What goes wrong

  1. Copying a value instead of pointing to it

    Every copy is a promise to update all the copies, forever. The day one update is missed, two screens disagree and nobody can tell which is right.

  2. Pointing to data that should have been frozen

    An invoice has to keep the price, address and tax rate it was issued with. If it only points to the current plan, a price change rewrites every past invoice, so records of history store their own snapshot.

  3. Splitting tables past the point of use

    Breaking every value into its own table means six joins to show one invoice. Normalise to remove copies that can drift, and denormalise on purpose, with a comment saying why, when a query measurably needs it.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Check our schema for values stored in more than one place, such as names, prices or plan details copied between tables. For each one, tell me whether it should point to a single source of truth or is a deliberate snapshot, like an invoice's amount, and write the migration for the ones that should point.

Quick check

Sign in to earn +10 XP for it

Harbor raises the price of the Pro plan, and last year's invoices now show the new price. What went wrong?

Got a prompt that touches normalisation?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.