Brian Phillips
Brian Phillips

Reputation: 4425

Using node.js in a production environment

I've recently begun hearing a great deal about Node.js. While I understand a few things that it's able to do, namely create a web server, I'm wondering if you could provide me with a solid reasoning behind using this functionality in a production environment.

This article made a solid case for using Node.js as a development tool, essentially stating that it can provide the usability of a backend environment without needing backend experience. I've also heard of many developers using Node.js in production projects (Codepen for example), but I simply don't understand how it can be useful when there are established web servers out there such as a LAMP stack.

I would love to invest the time into learning about Node.js due to its growing popularity, but because I do have a fairly solid backend foundation, I'm curious if it's necessary.

In short, what are some of the most useful aspects of Node.js and why would someone need to use in a production environment?

Upvotes: 15

Views: 9856

Answers (3)

mbokil
mbokil

Reputation: 3330

At my company we use Node in production everywhere. We typically serve the static HTML and JS files using NGINX but smaller apps will use PM2, a Node process manager, to add clustering redundancy and auto restart to a project. PM2 documentation

Example of using PM2 to maximize clusters for your Node app:

pm2 start -i max myNodeServer.js

Upvotes: 0

Chris Montgomery
Chris Montgomery

Reputation: 2354

The main company behind Node.js, Joyent, is tackling this question head-on with their recent roadshow "Node on the Road". They have collected a number of interesting testimonials of why big companies (Dow Jones, Walmart, Yahoo, etc) are using node in production. Check out their videos section for more details.

Upvotes: 1

Timothy Strimple
Timothy Strimple

Reputation: 23060

Perhaps the best answers can come from large companies who are using Node successfully in production.

Why Walmart is using Node.js

How we build eBay's first Node.js application

How LinkedIn used Node.js and HTML5 to build a better, faster app

Scalability is often the big reason. End to end javascript is also a popular answer. Also Node is good at making some potentially complicated "real-time" scenarios almost trivial when using a library like socket.io.

And here is a list of companies using Node with a short blurb on what they use it for.

Upvotes: 19

Related Questions