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

Fix possible scaling issues #41

Open
3 tasks
zachsa opened this issue Jun 2, 2022 · 1 comment
Open
3 tasks

Fix possible scaling issues #41

zachsa opened this issue Jun 2, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@zachsa
Copy link
Collaborator

zachsa commented Jun 2, 2022

There are a couple SQL queries that may need to be optimized in the future if a large number of projects / deployments are added.

In particular, the SQL query for tracking / asserting the 'rollup' relationship of projects into various tenants can be slow when called without a submissionId parameter (this query - https://github.com/SAEON/national-climate-change-response-database/blob/stable/src/api/src/lib/sql/merge-tenants-submissions.js). It would be better to refactor the function to NOT allow for calling without submissionId. And then refactor code where this function is called to loop over submissionIds and only call the mergeTenantsSubmissions function with both params specified potentially many, many times. Alternatively it's possible to increase the SQL Server connection timeout settings - https://github.com/SAEON/national-climate-change-response-database/blob/stable/src/api/src/mssql/pool.js#L20. But that is not the best idea since this would result in longer and longer startup times

@zachsa zachsa changed the title Possible scaling issues Fix possible scaling issues Jun 2, 2022
@zachsa zachsa added the enhancement New feature or request label Feb 13, 2023
@zachsa
Copy link
Collaborator Author

zachsa commented Jul 17, 2023

The easiest way to address the long running query on application startup is to increase the allowed connection time to sql server. This may be ideal, as the current process is useful for starting a dev environment

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

No branches or pull requests

1 participant