I am making a Rails application that will contain a lot of “computed” or “aggregated” data, that is, information that is computed by performing expensive operations on user-stored data. I think I need to somehow store this data, so A. I do not constantly perform expensive operations with the database and B. Therefore, I can spit out “reports” with good graphs over time, etc. For these attributes.
I am wondering what is the best way to implement this? I will need to calculate and save values (numeric) for a given model and how they change over time. I want this to be efficient and avoid duplication and data. Entries will be pretty much fixed after being created, so I don’t have to worry about things changing too much, although they need to be taken into account.
I just wondered what the most common approach to this is, and how should I implement it in a Rails application?
source
share