Question 27 / 50
ImportantHardDesignData Modeling
Would you embed product information inside an order line, or only store productId and $lookup the catalogue?
Think about it first.
Short answer
Store a snapshot of the fields the order must freeze — name, unitPrice, SKU — plus productId if you still need to join later. Looking up live catalogue data for old orders is how you accidentally change what the customer paid.
Why?
The catalogue is independently updated. The order is a historical document. Those are different lifetimes. Embed the snapshot; reference the product for 'current stock' and merchandising. Duplication here is a feature, not a smell.
Interview tip
Use the word snapshot. It tells the interviewer you distinguish live data from historical data.
Common mistake
Calling any duplication 'denormalisation we should avoid' without asking whether the copy is allowed to go stale.
How did you do?
Cheat Sheet