-
Notifications
You must be signed in to change notification settings - Fork 3
Multi Table Logic Execution
Rollups provoke an important design choice: store the aggregate,
or sum things on the fly. Here, the stored aggregates are Customer.Balance, and Order.AmountTotal
(a chained aggregate). There are good cases to be made for both approaches:
-
Sum on the fly - use sql
select sumqueries to aggregate child data as required. This eliminates consistency risks with storing redundant data (i.e, the aggregate becomes invalid if an application fails to adjust it in all of the cases). -
Stored Aggregates - a good choice when data volumes are large, and / or chain, since the application can adjust (make a 1 row update) the aggregate based on the delta of the children.
This design decision can dominate application coding. It's nefarious, since data volumes may not be known when coding begins. (Ideally, this can be a "late binding" decision, like a sql index.)
The logic engine uses the Stored Aggregate approach. This optimizes multi-table update logic chaining, where updates to 1 row trigger updates to other rows, which further chain to still more rows.
Developed with PyCharm
Technology
Explore Implementation