I'm designing the architecture of my application and I'm running into an issue. For the webshop every
Order entity has a relationship with a
Store and many
StoreItem's. This allows for quick fetching of information when a user wants to view the
However, when a
StoreItem is altered, or even worse, deleted, this information is no longer relevant/available when looking at the
Order entity. I have two possible solutions for this, and I would like your feedback on them:
Orderis created, copy the
OrderStoreItementities that will never be changed, even if the original entities are altered or removed. The
Orderwill now automatically reference to the
Orderis created, copy all necessary data as JSON into special fields in the
Orderentity. Every time data is requested, get the JSON and turn it into data the system can use.
If you know of a better way to do this, feel free to add it. I'm trying to keep everything relational, so no child objects/tables.