I am working on a high-performance real-time app, with node.js and mysql as backend.
In order to increase performance, I have a separate node.js process updating underlaying mysql bd. Update requests are enqueued to garantee sequencial execution (a must).
I am thinking about keeping a permanently open db connection in this process in order not to lose time on openning it on each request.
Other DB-requests (updates or reads) are served from the web-server node-js instance directly, possibly in parallel. These db-connections are of course created/freed in each request.
Do you see some cons of this approach?
UPDATE:
Important additional information. I've chosen this stand-alone process solution basically because of the following reason...
the logic that must be executed before each update is relatively complex and depends on data-structure in the database. Several additional queries would be necessary before each update. This stand-alone process has the complete data-structure in-memory and can perform these check-ups very fast and with no db access (performance boost).