I need to build a website which is served by live data in RDS (constantly updating data). For every website request we join multiple tables and aggregate data - ex. SUM, AVG. Since we join multiple tables and aggregate data for every website request this is very expensive and latent.
I was planning to aggregate old data (data older than the previous day) before hand and store it. So that on every website request I can just aggregate today's data (live) and sum up with already aggregated data.
Is there a framework to achieve this? Like an abstract layer (table) backed by 2 tables such that my application layer would never know about the 2 tables.