Skip to catalogue

157

denormalization

Copy a value to avoid a join. You now have two writers. Say who updates the copy.

What is denormalization?

Denormalization stores redundant data for read speed: the author’s name on the comment. Normalization kept it in one place. The cost of the copy is consistency: when the author renames, the copies must move or be defined as snapshots.

Why does denormalization matter when vibe coding?

Models duplicate columns “for convenience” and update only one. Name snapshot versus maintained copy.

How do you do denormalization?

If it is a snapshot (name at purchase time), never update it. If it must track the source, update it in the same transaction or via a projection. Do not leave a trigger you do not own.

How do you ask a model for denormalization?

Denormalize (field) onto (table) as a (snapshot that never updates / copy maintained in the same write). Do not duplicate it without saying which. Readers must not join for this field.

What goes wrong with denormalization?

Denormalizing into a cache and into a column and into a search index, with three update paths. One path.

adjacent