All Case Studies Design Development Interviews Our Way Project Management

When to Use Node.js as Your Backend

Node.js is an application runtime environment that allows you to write server-side applications in Javascript. Thanks to its unique I/O model, it excels at the sort of scalable and real-time situations we are increasingly demanding of our servers.  It’s also lightweight, efficient, and the ability to use Javascript on both frontend and backend opens new possibilities. It comes as no surprise that so many big companies have leveraged it in production. In this article, I want to discuss when it is worth using Node.js and in what cases it might not be the best idea.

Real-time applications

Node.js is a good choice for an application that has a high volume of short messages that require low latency. Such systems are called real-time applications (RTAs) and can be easily developed with Node.js. Thanks to its specifications, it’s a good choice for those real-time collaborative drawing/editing-type apps, where you can watch the document being modified live by someone else.

when use node.js backend

The list of RTAs that can be effortlessly developed with Node.js is much longer. One of the most popular ones are live-chat or instant-messaging apps. Node is also the right choice if you want to create a video conference app that will work with specific hardware or VoIP. Additionally, you might want to consider Node.js for online gaming apps or e-commerce transaction software, where online data is of much importance.


Node.js is very efficient with real-time applications: it allows handling multiple client requests, enables sharing and reusing packages of library code, and data sync between client and the server happens very fast.

Really fast and scalable environment

Ruby on Rails might not be sufficient in terms of speed if you have a ton of requests. Node.js will prove useful in a situation when something faster and more scalable than rails is needed. Its ability to process many requests with low response times, as well as sharing things like validation code between the client and server make it a great fit for modern web applications that do lots of processing on the client’s side.

Therefore, it is a popular choice among "single page application" sites where all the rendering is done on client’s side, while the backend just provides a JSON API.

It also comes in handy when you want to process a high volume of IO-bound requests. It won't really be all that effective if there is a lot of CPU processing required to serve the request. Yet, if it's primarily just shuffling data around, then it will be quite efficient because a single instance can serve a lot more requests with the same hardware compared to the usual "thick" application server (like with rails).

when use node.js backend

Bad Use Cases

CPU heavy apps

Even though I love node.js, there are several use cases where it simply doesn't make sense. The most obvious one is apps that are very heavy on CPU usage, and very light on the actual I/O. So if you're planning to write video-encoding software, artificial intelligence or similar CPU hungry software, consider using something else. While you can twist and bend things quite a bit, you'll probably get better results with some other technology.

Simple CRUD or HTML apps

While node.js will eventually be a fun tool for writing all kinds of web applications, you shouldn't expect it to provide you with more benefits than PHP, Ruby or Python at this point. Yes, your app might end up slightly more scalable, but no – your app will not magically get more traffic just because you write it in node.js.

The truth is that while we are starting to see good frameworks for node.js, there is nothing as powerful as Rails or Django on the scene yet. If most of your app is simply rendering HTML based on some database, using node.js will not provide many tangible business benefits yet.

Wrap-up

Both Rails and Node can achieve the same results. However, there are different situations where each one works best. With Rails, you can prototype and move fast, break things, and get a crud app in an hour.

Node, on the other hand, requires more resources, but it scales better, works great with real-time tasks and is faster overall. Hopefully, the tips above will help you pick the best environment.

If you want to learn more about the advantages and disadvantages of Node.js check out our article.

Node.js books
Developing in Node.js?
Order FREE code review

New Call-to-action
READ ALSO FROM DevOps
Read also
Need a successful project?
Estimate project or contact us