So, what exactly is Node.js and what are its advantages and disadvantages? In this post, I will briefly introduce you to Node.js and all that it can accomplish, as well as directing you towards some useful resources that will help you get started building powerful applications.
What is Node.js?
Basically, when you run another programming language (say, PHP) on your average server (say, Apache or nGinX), each new connection to the server is created in a new thread. As such, as the number of concurrent users rises, the load on the server rises too, and the only direct way to accommodate more users is to employ a better server, as and when the need arises.
In Node.js though, all of this changes, because the core server structure is handled by the coder themselves, thereby making is easier to create big web applications.
Why Should I Use it?
Now, this is where Node.js comes into play. It acts as *the server*, in a manner. Thus, much like Apache or NGINX, Node.js interprets the app code that run atop it.
However, unlike most other server side scripts, wherein a function needs to wait in queue before being executed as other functions are being completed, Node.js allows for asynchronous functions, which means everything runs together in the background. So whatever functions are specified to be run or executed at a given point, are executed, whereas the rest of the code proceeds ahead.
As a result, the direct and obvious benefits of Node.js are easy to count. It is fast, stable and above all, totally scalable. Imagine having to handle thousands of data manipulations concurrently on a PHP application? Node.js can do all of that, and do it much better, in a much faster manner!
Of course, Node.js has its own share of issues too.
Simply put, the biggest drawback that I have noticed is that Node.js is still relatively new, and is in fact yet to progress beyond its infancy. While you can set it up on your own server or a VPS and then play with it, it is not yet readily available on all platforms, especially if you are on a budget and are using a shared host. Most shared hosting servers have still not added support for Node.js.
Beyond that, it is not too tough to install and set up Node.js on your own machine. However, universal acceptance comes with time, and as of now, many web applications that are fully compatible with your average LAMP stack might not be apt for use with Node.js
But these are momentary issues, because as Node.js gains further momentum and rises in popularity, support for it will also arrive, much like PHP took its fair share of time in rising to internet domination!
Resources for Learning Node.js
First up, NodeSchool has open source workshops that you can check out in order to well acquaint yourself with the world of Node.js. Beyond that, if you wish to attain mastery over Node.js, the best place to head to is Tuts+. With a zillion courses, tutorials, and eBooks, there is a lot that can be learned, at your own pace!
Can’t wait to get started building something? Here are some tutorials and courses that will get you going in no time:
How about writing your own Node.js addons? Or maybe something about the asynchronous nature of Node.js? The event module? Or using Node.js to build a chat service? Yes, there are resources available for building it all!
And just in case you need more, you also have full-fledged courses to help you do more with Node.js — such as Node.js from Scratch, an introduction to Node.js as well as Node.js for the front-end developers, and many more!
Check them all out here!
Ever had that feeling that you jumped the ship too late, and ended up trying to catch up with the rest of the world? Node.js is currently lining up to be the next big thing, and as support for it increases, so will the number of apps and websites that use it.
If you’re looking to extend your web development skillset, you should consider giving Node.js a try! This is one programming script that has everyone talking, and your skills with Node.js will surely not go unnoticed.
Have you built anything with Node.js? How has your experience been? Share it with us using the comments below!