avniproject / avni-server

Backend APIs for Avni
https://avniproject.org
GNU Affero General Public License v3.0
5 stars 25 forks source link

[External API][Performance] Make retrieving catchment optional #718

Closed vinayvenu closed 2 months ago

vinayvenu commented 3 months ago

GET /api/subject/#id takes up about 16% of the resources on the common cloud, and is slow (median response time 3.3 seconds). More than 90% of the time and resources are taken up because we are trying to retrieve all catchments the subject belongs to. Making this configurable can make the API at least 10 times more efficient. Overall improvement in Avni performance will be is around 14%.

Acceptance criteria

image image
petmongrels commented 2 months ago

Introducing a breaking/forcing change by making the includeCatchments = false. So that only people who require catchment pass it explicitly. Making it true will mean we not get performance benefit unless people make change.

vinayvenu commented 2 months ago

Context, as far as we know catchments are used only for the Bahmni HWC integration. Not sure if it is still being used after the pilot.