I'm developing a telegram bot in nodeJS.
A question i keep asking myself is, can i initiate the connection once to my database and cache, and leave it open? Or connect when required and then close when the task is done?
Since there is only instance of the application unlike php, There would be only one open connection. All interactions to the application from the user will happen with telegram client and bot API in the middle. So, is it okay to leave it open or is that just not a smart or good idea?