Speed up the process

Options
I have an intake endpoint that will be getting a lot of user data. The function stack adds/updates a db record, then validates several conditions (involves hitting external APIs), and then prepares and sends an email to the user. 

I've noticed that this whole process takes about a second to run for every new record. I expect a large volume and wondering how to speed up the process so that a posting server doesn't need to wait too long for a response to process the next item in its queue (at least that's how I imagine this happening 😆).

Got a couple of ideas, but maybe there is a better way. Please suggest.
1.  Break the process into two? I am thinking of creating a "temporary" table for internal queuing. New records will be added there and then a task will be picking up new records in some batches, processing those and removing them from the temp db.
2. Or maybe I can do something in the main intake function stack that would accept a new user record and push it to another xano endpoint? Or will this still hold up the intake process until that other endpoint responds?

Comments

  • Brett Lewis
    Brett Lewis Member
    Options
    Option 1 sounds good to me.
    I'm going to do something similar for incoming webhooks - save the 'raw' data from the endpoint in one table. And then having a background task to work through the new entries in it's own time.
  • Valentin R
    Valentin R Member
    Options
     yep, ended up doing it like that. I left a few functions in the webhook and it now runs a second quicker.