I'm trying to code an "undo" or "rollback" type scenario. Part of me thinks I am over complicating this and it must have been solved before.
Background: I have a Product (eg A book) the product has 20 fields. A Product has a Media Type (PDF, Hardcopy, EPUB) and each Media Type has multiple pricing (price, location ie Europe, Asia, America).
Looking at previous questions, the memento pattern seems to be the closest but I'm not sure how to do the multi levels.
Eg, Change 1 - Create the Product "Coding for Dummies", it is available in Hardcopy and is available for $100 in Europe and $75 in Asia
Change 2 - Change the Europe Hardcopy price to $90. Add a PDF, it costs $90 for Europe and $75 for asia
Change 3 - Delete the Hardcopy record
Change 3 was a mistake, I'd like to rollback to Change 2.
Looking at previous questions, the Memento pattern seems to be be the closest, but I would duplicate an awful lot of data. ie in Change 2 & 3, you are repeating the Product, Media and Pricing.
The Dataset I am using has almost 1,000,000 products. (The above example is simplified) In reality, a Product has about 50 fields, the Media Type has about 15 fields
Is there a better way?