DEV Community

Discussion on: How to Manage Multiple Threads in Node JS

Collapse
 
srikanth597 profile image
srikanth597

yes, it makes all sense now.
Thanks for your efforts,
But I wonder what kind of such huge computational tasks exists especially on DB operations from Node.js programs so that I could use these techniques to improve the performance w.r.t to DB operations

Thread Thread
 
bleedingcode profile image
💻 Bleeding Code-By John Jardin

Always a pleasure. Most of the time it's going to come to advanced business logic that needs to perform a series of processes on returned data from DB or 3rd party queries, etc.

What you always want to be doing is keeping the primary thread and event loop spinning as fast as it can and processing those incoming requests. The moment you have tasks that contain synchronous logic that cause even the slightest of delays, hand it over to Worker Pool 👍.