I am new to Rails, coming from an intermediate background in PHP. I am trying to create my first shopify app that uses an asynchronous stream to perform backup and restore functions.
So far, I'm having no problems with the backup as it's only a few calls to download most of the information, but when it comes time to do an upload, I'm stuck with a long processing time made longer due to the bucket size and leak rate.
I was wondering how people get around this and if there is a way to update or create several products in one call?
I am using the ShopifyAPI gem, which uses ActiveResource as a base. I am having trouble figuring out how to get it to call asynchronously, but I think I saw posts already about that.
Any help is appreciated :)
It is not possible to reduce the number of REST API calls than the products that you are creating or updating, as it takes one call to make a post/put request i-e create/update call.
There is not much benefit out of making these calls asynchronously as you will quickly hit the call limit and depending on your production environment you might end up using too many threads. Also depending on your code structure, it might also cause problems in case of an error during a call if your just shooting out calls and not checking response.
You can make use of both REST API and GraphQL, if you think it will help in your system as their call limits are handled separately.
You can update multiple products with GraphQL but will exhaust the limits faster than REST depending on the data being sent through it, when your products have multiple variants and images GraphQL becomes costlier with its dynamic cost as compared to constant cost of REST calls.