Code execution limit

Hello,

I have a query about JS cloud code execution time, asking for direction as a non-developer.

I have a developer help me move some working code from Heroku to backendless (where I have the DB) and apparently it triggering the execution limit.

The code is used to fetch data from an external API which takes some time to process the request and return a response, around a second per query.

Its possible just one user will request up to 100 queries or more at a time in a new project, so I assume the code will need to run continuously in this example for up to 100 seconds to complete the full activity?

So in this example it seems like the 20 second upgraded limit would still be an issue.

  1. Theoretically is it possible to change the code in such a way that each external API request “executes separately” so the execution time is only 1 second for each API request. Not sure if that even makes sense, I dont know JS.

  2. Is it better to use codeless to fetch the external data as this would not be executing cloud code and not have a limit?

  3. Rather just leave this function on Heroku or other host for now and revisit later after basic idea is validated.

Thanks!

Hello @Jarad_Nelson

All three approaches are valid. Which one would work better for you depends on the requirements of your application.

  1. It’s possible, but you should write your custom JS code where you will be able to execute multiple requests in parallel, at this point this will possible only with code.

  2. See(1). Keep in mind that when logic is running in the browser you will be limited to only 6 parallel requests at a time.

  3. If this approach already works for you and development time is of the essence, I would recommend keeping it as is and revisit later.

Regards, Dima.