People buy stuff in a web shop.
I take their orders and save them to a database. For each ordered item, I need the quantity and the information about the item. At the very least, I'm going to need to save the current price and name of each item but I would really prefer to save everything.
And here comes the question... What's the best way to keep all the information about each ordered item as it was at the time of purchase?
- Copy into a separate table with the same columns as the product table
- Make copies of products in the same table, marked as non-editable, non-viewable copies
- Some sort of copy on write schema that saves some space until the "live" product information is actually changed?
- ????
For simplicity, let's assume all product information is kept in a single table.