I am pretty sure you have heard about Node.js. Basically EVERYONE is talking about it right now; everyone wants to learn it, web development trends seem to be moving towards it and even huge sites like LinkedIn, eBay and PayPal have their entire infrastructure based on it.
But, really, why has it become so popular all of a sudden? Sounds like yet another web technology like any other else, right?
Well, in a nutshell:
- It is lightweight Node.js uses an event-driven architecture which means everything done on it, every single call and operation, is a chain of asynchronous callbacks. This allows Node.js to run on a single thread, different to other web technologies, which spawn a new thread per-client request. This is the very foundation of the non-blocking I/O nature you may have heard that is Node.js’ main feature.
- Built-in support for object databases It is really common for Node.js applications to use object databases such as MongoDB. MongoDB, contrary to traditional SQL databases, it uses a document-based model instead of a relational model; this means that instead of tables, it uses objects resembling JSON. Just the right answer for ORM fans.
- Can be hosted almost anywhere Several web servers and cloud-based hosting providers support hosting of Node.js web applications out-of-the-box. To mention a couple: Google, Microsoft IIS, Heroku, Microsoft Azure, Amazon (AWS), and a bunch others.
Node.js event-driven architecture. Image by Toptal.com
So, that’s my two cents on the matter. I’ve been getting my hands dirty with Node.js these last weeks and have been a hell of a ride. It keeps becoming more and more a necessity to learn its ways as time passes. I’ll be posting on my findings soon.
In the meantime, here is an interesting guide on when and where to use Node.js and, if its the case, how to convince your boss about using it for your next project.