Hi,
I am using the dataValueSets endpoint to sync data between an external system and some DHIS2 aggregate datasets.
The datasets in question have attribute combinations so that different partners can enter their data.
Up until now I have used the bulk update method of updating these datasets via the dataValueSets api endpoint. This has worked really well, but after adding the attributeOptionCombo field to the object the performance has dropped significantly, to the point of timing out on some of the larger updates.
The data I am sending is in this format:
{
period: "2021",
attributeOptionCombo: "partnerCode",
dataValues: [
{
dataSet: "someDataSetCode",
dataElement: "someDataElementCode",
orgUnit: "someOrgUnitCode",
value: "123"
},
...*more values*
}
I am sending it with the following query parameters instructing the api to match on codes rather than IDs:
dataElementIdScheme=code&categoryOptionComboIdScheme=code&orgUnitIdScheme=code
The performance is really, really slow. Anyone run into this issue? Any advice on speeding this process up. Currently I am just syncing one IU and period at a time, which is going to involve a really, really large number of POSTs to the DHIS2 api and is less than elegant.
I could also try using the async query parameter, but I am concerned that the database itself is going to get overloaded if I do that.
Any advice would be greatly appreciated.