Take the 2-minute tour ×

Checking out the following modules for connecting to mysql db:




Do they actually use asynchronous IO or they just use green threads?

Thank you!

share|improve this question
Why do people have trouble with this concept: there is no threading in node.js ? –  Elf Sternberg Feb 5 '12 at 17:56
@ElfSternberg No joke: stackoverflow.com/questions/9151788 –  Rohan Singh Feb 5 '12 at 20:17

1 Answer 1

up vote 3 down vote accepted

The first two are JS based. I believe they both use events but also take callbacks. The last one uses lib_eio to take a callback and fire it when the C++ method finishes firing.

Node, in JS land, doesn't have threads. Node runs in an event loop. That is why it is important for tasks that wait for responses or have latency (network calls, FS read/write, etc.) to be async.

These DB drivers would be next to useless if they weren't because they would block the execution thread until they got a response from mysql.

share|improve this answer

Your Answer


