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 typeorm db usage #593

Open
JannikStreek opened this issue Nov 27, 2024 · 0 comments
Open

Optimize typeorm db usage #593

JannikStreek opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@JannikStreek
Copy link
Member

JannikStreek commented Nov 27, 2024

Proposed feature
DB connections are rare and should be used with care. There are many places in the code where redundant calls are being made. For instance, typeORM's save makes actually two requests: Checking first if the entity exists and then either inserts or updates. And before that we often call findOne which is redundant at this point. We should use insert or update instead of save. Listeners and subscribers are not triggered without using save, but I don't think we use these features. However, double check if the modifiedAt / insertedAt fields still work without save.

Additional investigation: Also, it would be interesting to see how we can improve the current update logic of nodes: I guess when moving around a whole branch of x nodes, x requests with updates are triggered? Can this be improved?

@JannikStreek JannikStreek added the enhancement New feature or request label Nov 27, 2024
@JannikStreek JannikStreek changed the title Optimize typescript db usage Optimize typeorm db usage Nov 27, 2024
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

2 participants