Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's worth noting that DB drivers that actually integrate with libuv are a minority - most DB divers use Node-level network APIs and are unaffected by such thread pool limits.


Even when the db drivers integrate with libuv, there is little reason to use blocking APIs for that. The threadpool is primarily used for operations for which no non-blocking API is available (mostly filesystem access).


Why would a DB driver need to integrate with libuv in the first place?


In the case where the driver (for instance the official libmysql) doesn't expose its network interface (e.g. its sockets can't be used with an external event loop). In that case, it would block on IO operation, and there is no other choice but to push it to another thread.

That said, using a driver in another thread leads to various complexities that can be avoided when running in the same application (javascript/v8) thread/event loop.


To be evented and get the respective performance gains in a Node setting?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: