I'm writing a Node app that accepts TCP connections. I have a few separate Node modules (utilizing the exports functionality). Each needs a database connection to handle some of their functionality.
What's the best way to architect/handle database connections? Should each module create a separate connection or should my main JS file pass in a database connection handler to the modules when I require them?