Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Donut Chart + Tree Chart Data Retrieval #237

Open
2 tasks
eeshabarua opened this issue Jan 5, 2024 · 1 comment · May be fixed by #238
Open
2 tasks

Optimize Donut Chart + Tree Chart Data Retrieval #237

eeshabarua opened this issue Jan 5, 2024 · 1 comment · May be fixed by #238

Comments

@eeshabarua
Copy link
Collaborator

eeshabarua commented Jan 5, 2024

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

  • Understand MongoDB triggers (MongoDB doesn't have stored procedures)
  • Weigh the benefits of Response Caching to speed up retrieval on reload / rerender

Todo

  • Build a response object cache with aggregate Donut / Tree data
  • Add trigger to MongoDB cluster that populates Donut / Tree chart aggregated data cache on db update

Useful Links

@kennykos
Copy link
Member

kennykos commented Jan 5, 2024

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.

@eeshabarua eeshabarua linked a pull request Jan 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants