Web-development – good reason to avoid node.js for non-realtime web apps

node.jsweb-applicationsweb-development

I've seen a lot of talk about how awesome Node.js is for realtime web apps — things that need sockets, Comet, AJAX-heavy communications, and so forth. I know that its event-driven, asynchronous, thread-driven model is also good for concurrency with low overhead.

I've also seen Node.js tutorials for more simple, 'traditional', non-realtime apps (e.g., the standard blog example, which seems to be the standard 'Hello World' for people learning app development). And I also know that node-static allows you to serve static assets.

My question is: is there any good reason to avoid Node.js for traditional web apps, like classifieds, forums, the aforementioned blog example, or the sort of CRUD apps you build for internal business applications? Just because it excels at all the funky realtime stuff, does that contraindicate it for more staid uses?

The only thing I can think of, off the bat, is the lack of mature libraries (although that's changing).

(The reason I'm asking is that I'm considering ditching PHP for Node.js, mostly to get over the impedance mismatch of switching between languages, but also so I can reuse validation code and whatnot. My superego admonishes me to choose the best tool for the job; however, I don't have a lot of time to learn fifteen languages and all their userland libraries just to have a comprehensive arsenal. It's also reassuring that Node.js might give me an easier optimisation path than PHP/Apache in the future when I have to start thinking about heavy traffic.)

[EDIT] Thanks for the answers so far, folks; I just want to see if anyone else will weigh in before I choose an answer. The answer from @Raynos kinda confirms what I'm thinking, and the links from the commenters provided good food for thought, but I want to see if anyone else has any Node-specific answers, like 'DON'T USE NODE FOR PROBLEM X'. (Besides high-CPU tasks; I know that already 🙂

Best Answer

is there any good reason to avoid Node.js for traditional web apps

Yes, if you have N years in web platform X then clearly you can developer an application in platform X faster.

If you want to do Y and platform X has a pre-made solution Y that does X then do so.

All the generic reasons of why you should use one platform over another.

the sort of CRUD apps you build for internal business applications?

Yes there are other platform that let you write a generic application faster, ruby on rails comes to mind.

However, that said. I have experience with node and can't claim I would choose another platform over node unless it does a massive amount of features out of the box for me.

Basically it's a simple question of

Does a tool exists that does all of this for me? No, then pick the most convenient platform to write the tool.

There are no solid reasons why node.js is an inconvenient platform (other then "i hate javascript")