I’ve built a basic catelog app using Parse and it all works beautifully, although I bumped into something the other day that was a bit unexpected…
The node parse sdk seems to make network requests for each interaction with the system. I guess this makes sense, seeing as it’s the same sdk used in the browser, which will obv cuts down on maintenance and if it works from the browser, my guess is it’s all using the rest api under the hood, yes?
The thing that caught me off guard is that I was getting a bunch of 503s when doing many updates to my
Product class using a script on the server (details below if you’re interested). The script uses async await, so the requests are staggered to avoid bringing the server down.
Natrually, none of this made sense at first, as the server should easily handle the requests and it didn’t seem to be under any serious strain.
After looking around for a while, I realised it was my nginx config that was limitting my requests to 20 req/s (something I had set).
Does anyone know if there’s a way to either whitelist the requests coming from the sdk or perhaps have a suggestion/pointer to better practises for doing bulk updates?
My app pulls a csv file every 2 min, which contains updates to product stock counts and prices (there are abot 3k products). I reduce load on the server by storing a copy of the file on the server and doing a diff between the incoming file and the stored file. In this way, I only ever touch products that have actually changed.
Having said that, there have been a few occassions where the system got out of sync for whatever reason, which meant that I had to process the whole file to sync the system back up with the file.
I know there is a batch operation feature built into the rest api, so it dawned on me to use this, but I’ve never done batch operations using the sdk…I can’t find any docs that speak to how to do this?
I’d appreciate any thoughts/pointers/suggestions