I'm building a web app that shows the number of enquiries in a given date range. For example, the user will select "Last 14 days" and it will display a chart of the enquiries
The chart will then have to update itself as the enquiries grow that day.
The data is stored in MySQL on a database server. The web app is written in python.
What would be the best approach to tackle this in your opinion? with two questions in mind:
Would you handle the querying the data on the SQL side? (so python calls a specific mysql query based on the user input - SELECT * from TABLE where date = x (where x = user input for example) or would you download the whole table and do the manipulation within python? Or a combination of both given that number of enquiries for all previous days won't change after that day has finished?
Would you set a loop in python to download the database every 5mins or so, check for changes and update the chart? or handle it another way?