I have a PHP/MySQL-Twilio app. I edit "templates" in the PHP app, and when a texter texts in via twilio they are served one of the templates in a text message.
Lately I've been dabbling in Node, mostly just to write little scripts, not whole applications. I think using Node for the texting interaction would be a really good idea, but I've made an assumption:
The node process would run continuously, keeping a mysql connection open. It would be faster than PHP because the connection wouldn't have to be opened and closed for each twilio request.
Is this correct? Does it make sense to rewrite this corner of my project in Node for that reason? I'm not quite ready to rewrite the whole thing.
You can open and close connections on every request if you wish, howevere connection pooling is also available for NodeJS. PHP has pooling support too, it keeps some connections open in the back where you cannot see but does not notify. In NodeJS, you have to deal with it yourself. There is helper modules to achieve this, I would certainly suggest you to have a look at this example It is not such a big deal.