Loop faster or send multiple external api calls simultaneously?

Options
aissa
aissa Member
edited March 2023 in ❓Other questions

Hello everyone,

I'm exploring Xano as a potential solution to manage complex workflows on tables with sometimes more than 1M records. We use Bubble, some processes are working fine there, so as a first step the idea is to use Xano to get data from diff bubble tables, make the complex data transformation and then send it back to bubble. I've been doing some testing (function stack, etc..) and Xano sounds promising!

Only when I wanted to send back the data on bubble it seems that I can't do is as fast as I would like to… For the creation of new records, a loop combined with the bulk create API call from bubble can do the trick, but if I want to modify or replace data (PATCH/PUT) it seems my only option on Xano currently is to do a loop on all items and send them one by one to bubble, which actually takes a lot more time than the bubble native update WF combined with a recursive WF... Is that the only way or is there another way to make multiple API calls simultaneously on Xano?

@Michael Udinski?

Thanks!
Aissa

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    YOu can make multiple simultaneous API calls from Xano using a lambda and a Promise.all within it to fire off the requests in parallel. A little trickier (async systems always are) but doable. Maybe that will help?

  • aissa
    aissa Member
    Options

    Hi Ray, thank you for your help and solution, my question was more if there is a way to do it without code :) But indeed that could probably be the solution, I'll have to learn and research how to do it though, if you have recommendation on where I could find documentation that would help a lot!

    Thank you!

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Here's the Xano lambda documentation: https://docs.xano.com/working-with-data/lambdas-javascript

    As for how to use promise.all with fetch for multiple simultaneous requests, that's a google search or a deeper dive and the implementation will depend on your needs.

    We work on the hardest 5% of no-code/low-code in our forum and daily office hours at Statechange.ai, including this kind of "just the right amount of javascript" situation.