0

I checked with meta and apparently this is the best place to ask!

The company I work at have many environments, and as such, many Nagios/Icinga etc boxes in each environment. We currently have a dashboard, but it was created quickly many moons ago and needs replacing. It currently scrapes the HTML of every box, builds a static HTML file and repeats.

I put together a proof of concept using PHP/MySQL (as I'm good at it) which has a page which is dynamically generated from a MySQL DB, and then there's a background script which fetches data from Nagios/Icinga API's (or resorts to scraping where no API present). This works fine, but I've been itching to learn Node.JS and from what I've read it's good for dashboards - especially as I may want interaction in future.

So, my question is where abouts in this does Node.JS site, and where abouts does it not sit? For example, should I be using Node.JS for the dashboard itself sat on something like MongoDB (never used it, but would like to try NoSQL for once) to show people the current problems etc and then I have a script in the background in PHP/Perl that does the fetching scraping? Or (option 2) does Node do the dashboard AND the fetching of data? Do I have two instances of Node? I'd also like to have a web-based config page (like an admin settings page) rather than flat file settings - again, is this something easily done in the same Node structure or is Node quite single purpose (just display a dashboard, just fetch, just do forms etc)

I could accomplish all of the above with PHP/MySQL fairly easily and quickly, but Node.JS and MongoDB seem really popular nowadays and I feel like I'm missing out.

1 Answer 1

1

I don't see why you should mix php and node. Both are server side platforms. If you want to be fast, do it with php. If you want to discover a new platform, do it with node. Both tech fill almost the same space in a web app stack.

3
  • +1 in a web app stack they fill exactly the same purpose. That said; outside of the space of an http server node.JS serves a great many service purposes that PHP doesn't. Just a note worth keeping in mind, people shouldn't confuse them as having the same scope and use, but rather overlapping scope and use. Commented Mar 12, 2014 at 16:52
  • One thing that confuses me though is there's a lot of talk around Node being a single thread, so to speak. With PHP I'd have a script to show the dashboard, a script to fetch the data, a script to administer the dashboard etc. With Node, can I have multiple scripts for different jobs (called by cron etc) or is it all in one place?
    – Dan Walker
    Commented Mar 13, 2014 at 6:11
  • @DanWalker I am not sure about your point. You can separate your logic in different files, and configure the routes to map urls to your code. Your app will run in only one thread, which is an advantage in 90% of web apps. In your case, I don't think you have cpu intensive computations. Commented Mar 13, 2014 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.