CSE Roadmap

Common tier · about 3 hours · 5 parts

Part 3 of 5 · 1 min read

The real cost: keeping the duplicate consistent

Every denormalized copy needs an explicit plan for staying correct when the source changes.

Think of writing someone's job title on a hundred different printed badges. The moment that person gets promoted, all hundred badges are now wrong until someone reprints every one of them.

In plain words: every denormalized copy of a fact needs an explicit answer to "what happens when the original changes." Without a trigger, an application-level update routine, or an accepted amount of staleness, a denormalized copy silently drifts out of sync with its source, becoming simply wrong.

A worked example. If an author's name is corrected after a typo, every author_name_snapshot already written needs updating too, or those existing receipts will keep showing the old, wrong name forever.

The key lines. A trigger keeping the denormalized copy in sync, as one possible answer to the consistency question:

CREATE TRIGGER sync_author_name
AFTER UPDATE ON authors
FOR EACH ROW EXECUTE FUNCTION update_order_items_author_name();

Denormalization consistency cost

The denormalization consistency cost is the ongoing responsibility to keep a redundant, denormalized copy in sync with its source, through a trigger, an application update, or an explicitly accepted staleness window.

Example: without a plan like the trigger above, correcting an author's name in authors would silently leave every already-written author_name_snapshot wrong.

Remember this

Denormalization is not free speed. It trades read performance for an ongoing consistency obligation that someone has to actually own. A denormalization decision without a named answer to "how does the copy stay correct" is an incomplete decision.