flutter – How to handle multiple request at same time in Node.js?

I’m currently overseeing the management of a medium-scale application, which operates with a Flutter frontend and a Node.js backend. However, we’ve encountered an issue wherein response times from our APIs are occasionally unacceptably lengthy. Upon investigation, I discovered that when Node.js is occupied with time-intensive processes, it delays responding to subsequent requests until the ongoing process concludes. For instance, if a process is underway, such as sending notifications to a large batch of users or compressing a video, any concurrent API requests remain in a loading state until the prior task completes. Once the notification dispatch or video compression concludes, the API promptly provides a response to the pending user request.

To address this challenge and ensure a consistently positive user experience, I am seeking solutions to preemptively mitigate such delays in our system. Your insights and guidance on resolving this issue would be greatly appreciated.

Thank you.

Read more here: Source link