In the following example

```
Order
-------
ID (int)
CreatedAt (smalldatetime)
....

OrderItems
-------
ID (int)
OrderID (int)
Quantity (int)
UnitPrice (decimal)
CalculationUnit (int)
TotalItemPrice (decimal)
....

```

I have a big dillema where and how should i keep track of TotalOrderPrice and I my main concern is speed and data consistency.

a) TotalOrderPrice could be stored in table Orders and should be updated on each OrderItem change for relevant OrderID

Could this lead to data inconsistency since data is "duplicated"?

b) I could have a view that could hold summed TotalItemPriceValues such as

```
OrderTotal
------------
ID (int)
TotalOrderprice (decimal)

```

Could this be a potencial issue when scaling application?

c) Or I could leave the original design as it is, and calculate OrderTotalPrice inside a business logic.

Could this slow down performance since all order items should have to be retrieved in order to get the total order price?

I know there are no silver bullets, but since I dont have large amount of data for testing, I just want to do facts check and see what would be a proper reasoning to find the solution here?