Pick the fix
Order history must show the price customers actually paid, even after products are repriced. Schema choice?
Hint 1 of 1
Is the price paid a fact about the product or the order?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Store unit_price on each order line at purchase time
Correct. It's a historical fact of the order, not a copy of the current price.
Normalisation removes copies of facts that should stay in sync. The price paid is a separate fact fixed at purchase time, so storing it on the order line is correct, not duplication.
Why not the others?
- B Join order lines to products for the price. Shows today's price, rewriting history.
- C Keep a price-history table and join by timestamp. Possible but complex; the order already knows what was charged.
- D Cache product prices in Redis. Caching current prices doesn't record past ones.