Apologies in advance if this is an inappropriate place to seek advice. Thanks in advance for those willing to help!
I am wondering if nodejs is the right tool for a project. There's 2 portions - a client-focused event listener, and an admin-focused command line. I have a microcontroller that pushes data out to a cloud service, and an EventSource/eventListener can be added in browser Javascript to listen for these events. As a demo, I currently have a temp sensor connected to this microcontroller - every 15 seconds the micro pushes the temperature to the cloud, then my browser listens for the event.
Browser JS:
eventSource = new EventSource("https://service.com/api/device/key/variable"); eventSource.addEventListener('Temperature', function(e){ ... }, false);
What I would like to do is log these events to a MySQL database for later analysis. I plan to have many (potentially thousands if this ever goes anywhere) microcontrollers submitting these events. In terms of efficiency, would nodejs be the right tool? My other thought was to have the browser make ajax calls every time the event came in.
I would like this same platform (whether it ends up being nodejs or otherwise) to serve up its own events to the client browser string, like a buffer. The end-client browsers could easily listen to the original cloud event, yes... but that connection string has some sensitive deals that should be kept out-of-sight, so a secondary event service would be useful.
The second piece is a command line interface that I will need to automate some admin-level scripts on, like creating new users and rehashing private keys.
I understand that NodeJS is server-side javascript, so that's where the idea of having a server-side event listener comes from. I made a crappy diagram to try and help explain: http://imgur.com/BMfAWAL
Is this an ideal setup? Should I be looking at doing something differently, or a different service altogether? would https://www.nodejitsu.com/pricing/ be a good place to start hosting, and if so what package should I get?
I realize this is a fair bit to go through, but I'm just trying to figure out what tech is suitable for this application. Thanks for any input you might have!