Hello,
I'm trying to sync data from one service to another. I pull down the data since the last time I ran the sync code. Then loop through and send each item to another service. There is no bulk upload so I have to make the requests one by one.
Currently I'm looping through and sending off the request then saving locally when the request is successful.
I'm thinking of changing it to storing the data locally first then saving it to the other service and marking it as synced. That way I can always re-try if there is an error.
However, I'm wondering what are some good practices while making http requests in a loop?
When one request fails, do I keep going?
Do I fail silently and let the user know what ones didn't sync.
Do I implement auto retries.
Do i try and run the whole process in a job or make each sync it's own job ?
Do I run it as a background process with sleeps to not overload the other service throttles.
I'm using Laravel Saloon for my http request manager
Thanks.