You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know how database connections works internally, but I have a question I haven't been able to find the answer to, so here we go.
It says in the README:
Rather than creating and managing connections one-by-one, this module also provides built-in connection pooling using mysql.createPool(config).
I wonder how/if a web application in Node.js would benefit from using a connection pool instead of a single persistent connection created when the web application starts. Is a connection kind of "blocking" so it can only send one query to the database at a time, so it can't send the next one before it has received back the result for the previous one? Otherwise, what would the benefits be of using a connection pool?