I'm making a Rails app which will feature a lot of "calculated" or "aggregated" data, i.e. information which is computed by performing expensive operations on the data stored by the user. I'm thinking I need some way of storing this data so A. I am not constantly performing expensive DB operations, and B. So that I can spit out "reports" with pretty graphs over time etc for given attributes.
I'm wondering what the best way to implement this is? I'd need to be calculating and storing values (numeric) for a given model, and how they change over time. I want this to be efficient and avoid duplicating and data. The records will be pretty much fixed once created, so I don't need to worry about things being changed too much, though it needs to be considered.
I just wondered what the most common approach to this is, and how I should go about implementing this within a Rails app?