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

Add skipValidation support to find and update methods #102

Merged
merged 3 commits into from
Jul 15, 2022
Merged

Conversation

Pl217
Copy link
Contributor

@Pl217 Pl217 commented Jul 15, 2022

This is to support UN-OCHA/hpc-api#94

This PR adds skipValidation option for find and update methods of our models. This feature skips data validation that we do with our io-ts codecs. It should be used very rarely!

We've seen some endpoints suffer from significant slowdowns (like in UN-OCHA/hpc-api#94) due to data validation and it takes a significant portion of time to complete the query. For example, when fetching attachments by their IDs, data fetching takes 20-25% of time, while validation takes 75-80% of time, which can be a huge burden, causing timeouts of our APIs.

@Pl217 Pl217 added the ready for review All comments have been addressed, and the Pull Request is ready for review label Jul 15, 2022
@Pl217 Pl217 requested a review from a team as a code owner July 15, 2022 10:21
@Pl217 Pl217 merged commit 7808585 into develop Jul 15, 2022
@Pl217 Pl217 deleted the skip-validation branch July 15, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review All comments have been addressed, and the Pull Request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants