toriis-portal / toriis

Transparent and Open Resource for Institutional Investments
https://www.toriis.earth/
MIT License
8 stars 3 forks source link

Optimize Donut Chart + Tree Chart Data Retrieval #237

Open eeshabarua opened 10 months ago

eeshabarua commented 10 months ago

Description

Currently, the donut chart and tree chart components run a tRPC procedure on every reload, which can lead to performance issues. Optimize the data using a MongoDB aggregation or stored procedure.

Learning Objectives

Todo

Useful Links

kennykos commented 10 months ago

We should use mongodb triggers instead of a stored procedure. The trigger should execute every time the the relevant collections in the production DB is updated.

Also, it would be nice if we could store these triggers in the repository instead of mongo's website so we could have nice version control and peer review, but that isn't a deal breaker.