If you are already using Node.js, good for you! Please tell us your reasons for choosing in our comments section. If you are evaluating Node, let me share some pointers from our experience on the good, bad, and ugly.
Node.js is great if your application is
- IO bound. Though every language now has an event-driven framework (Rails EventMachine), Node.js is grounds-up for this and has the richest ecosystem of Asynchronous libraries.
- Real-time that requires a quick response but not a lot of heavy lifting per request.
- High concurrency. Node.js’s event based model plays really well here as against the traditional Thread per Request model.
- One ring to rule them all. If you prefer the same language in both client and server.
- If the team prefers a dynamic language and comes from a Ruby/Rails or Python/Django background.
Not so great
- For CPU-bound computation. For instance predictive analysis.
- The ecosystem is still not there compared to Java. It’s fast maturing, but it is going to be a while before you see a Kafka or Drools in Node.js.
- You are going to miss simple things like Database migrations. Nothing like Rails migrations or Play Framework Evolutions is available.
- Can sometimes lead to difficulty to maintain deep-nested callbacks but various standard ways of tackling this are maturing.
- For Large code bases. This is a personal preference. If you have a large code base, worked by different teams with a long shelf life, refactoring is a must. Statically typed languages have better tools and support for this.
If yours is an Enterprise application, especially on-premise, I would think twice before choosing MEAN stack. JVM-based tools are accepted almost in any IT. IT Operations of many enterprises will not support stacks like Node.js or Rails.
When we developed our own Radaptive PAAS product, given that we built our own type class system, something like Ruby/Mongo was the best technical fit. But we chose to go with a JVM-based stack. Adaptive is currently deployed successfully in clients like Ericsson and Motorola which would not have been possible at all with a non-JVM stack. If yours is a SAAS application, this is a moot point.