Contrived example, but say I have an Order
aggregate with OrderLine
entities. The order line contains cost, quantity and the name of the product. The aggregate is persisted as events to be event sourced. Typically, a single product could have millions of orders.
I now have to update the name of the product. Updating the product aggregate is simple enough but I now have millions of orders with the old product name.
This is a contrived example but assume I need to update this copied state in my orders. What’s the best approach here? Applying the state change to such a huge volume of records seems incredibly expensive operation.