hotosm / tasking-manager

Tasking Manager - The tool to team up for mapping in OpenStreetMap
https://wiki.openstreetmap.org/wiki/Tasking_Manager
BSD 2-Clause "Simplified" License
509 stars 275 forks source link

Compute and store aggregates for API consumption #2011

Open ramyaragupathy opened 4 years ago

ramyaragupathy commented 4 years ago

Our current codebase on stats endpoints run all time computations as and when an API call is made and all these operations are performance heavy on RDS. I propose to pick some best practices from Missing Maps Leaderboard backend.

So we save loads of time on task history read operations for stats endpoints. Pre computing data will also help us include additional fields on our endpoints without worrying about DB performance.

We're already following a similar approach for notifications, let's also work on similar lines for stats.

This will be a heavy lift and we can begin here after wrapping up notifications.

cc @xamanu @willemarcel @fitoria @JorgeMartinezG

ramyaragupathy commented 4 years ago

Related: https://github.com/hotosm/tasking-manager/issues/2003