How do I speed up this process?

Hi,

I am looking for ways to speed up this process: I have a sign up process that captures quite a bit of user data, like multiple personal interests and hobbies. There is a main dataset for user information and separate datasets for interests and hobbies. As I am interested in finding out how many users have what interests and hobbies, during the sign up process, I use insert reference API to get the hobbies and interests id inserted into the main database. However that significantly slows down the loading time as when a user chooses the interests and hobbies from the dropdown menu, it first check the ids of the chosen hobbies and interests, then insert them into the main database as reference. Multiple promises need to be completed before the next page will load. And it’s not great when it comes to speed, pretty slow.

Can any one suggest a better way to complete this process?

Thanks!

If I understand you correctly, it sounds like you are doing a database call (insert a reference) after every selection that the user makes. Consider using an array to capture the user selections, displaying them in a table on the page as they are selected. Once the user is happy with the selections, have them click a button to save all the selections at once. This button could invoke a backend module to perform the database tasks to create the references.

Thanks for that Dave. Do backend modules in general run faster than front end calls? Will give this method a go. Cheers!

@huangchingyun If you handle database calls in a backend module, you eliminate the traffic between the front end and the servers where the databases are housed. The will reduce response time quite a bit.

@huangchingyun If you share the code you are using there may be other ways to provide optimizations. In general the more processing you do in the backend the quicker things will be.

@stevesoftwareservice @davebogan98 Thank you very much for your help! I am currently optimising the codes I have and move all database calls in a backend module. It certainly feels quicker! Trying to use more session api and break the process into smaller chunks too so there’s not too much to process through the steps!