In NodeJS applications, what is the best strategy for managing number of connections when transactions are involved (mysql community version)?
So, this is my line of thinking -
1) Do not hand over control to an ORM 2) Treat connection as an expensive commodity 3) mysql module for nodejs appears to be creating more connections
Given that, if n promises are executing at the same time (single thread part is understood), each representing a transaction, I do not want each of them create n connections - that much is obvious - but what happens when a transaction needs to be rolled back on a connection, if a connection is shared between promises? ..I do not want one transaction to fail if a another one fails as well..I would expect the 'connection' object to be little more intelligent..such that when beginTransaction is called, it provides a localized context...but just want to confirm if this is the case - I am looking for some documentations. If not, some sort of FIFO queue to facilitate sequalizing these transactions appear to be the way forward - but don't we already have one? What are other strategies you folks deployed?