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

Cache counts on /api/v1/facility/ route #2481

Open
sainak opened this issue Sep 22, 2024 · 2 comments
Open

Cache counts on /api/v1/facility/ route #2481

sainak opened this issue Sep 22, 2024 · 2 comments

Comments

@sainak
Copy link
Member

sainak commented Sep 22, 2024

/api/v1/facility/ is causing n+1 quires due to count of beds and patients,
to optimize this, instead store the count in redis
tasks:

  • store count of active patients and beds in redis
  • invalidate count when the data changes
  • come up with an optimized way or storing count of multiple facilities if it doesnt exists
  • make the helper funcions abstract so that they can be used with other fields/models
@JohnLu2004
Copy link
Contributor

@sainak May I work on this issue?

@gigincg
Copy link
Member

gigincg commented Nov 1, 2024

Additional Context, the issue is to use the approach in #1349 but abstract out the helper functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants