I am using node-mysql module (https://github.com/felixge/node-mysql) OR (http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/) .
Is this API handling connection pooling as well?
I mean with every user request I am calling Client.connect() to query the MySQL and to release the connection: Client.end().
Is this the right way, or should I connect/disconnect only once in a code.
I am learning from this document: https://github.com/felixge/node-mysql/blob/master/Readme.md
Update: Feb 2013 – pool support has been added to node-mysql, see docs
Example using built-in pool:
Pre 2013 solutions:
You can use node-pool or mysql-pool or use your own simple round-robin pool
now you can hope to have all queries callbacks to execute in 1 second: