4 ms·
In a non-relational model, you'd generally copy the items/products and their quantity into the shopping cart. That's a huge change from the relational model, a
by perlgeek 7y ago
In a non-relational model, you'd generally copy the items/products and their quantity into the shopping cart.
That's a huge change from the relational model, and takes much more space than a normalized approach, but it also comes with some advantages. For example, it makes sure that the price of the items in the cart remain constant, even when you change product prices. That way, you don't have to inform the user "oh, your cart just got 8% more expensive" before checkout.
- projektfu 7y agoAgreed. Invoices, for example, are a representation of history so they need the exact data that was used at the time. They can have a reference to a product id but at any time it's possible for the data associated with that product to be completely changed from the meaning at the time of the invoice. This happens with, e.g., UPCs, which can be reused. On the other hand, if you have assemblies of products then you probably want those items to update themselves automatically.