We at langoor.mobi are really excited to part of the mobile revolution. This is the time when leading companies in every domain are facing questions about their future earning streams on the basis of their mobile presence. This is the era when people are realizing that a bad mobile experience can damage a company’s brand.
Let’s get to the point. Mobile is growing. So is HTML5. Together they have triggered the rise of “Real time Web” and real-time web requires real-time technologies like Node.js.
Node.js – “In the focus”
Prime-time companies have relied on Node.js for their mobile solutions.
LinkedIn is a prominent user. Their entire mobile stack is built on Node.js. They went from running 15 servers with 15 instances on each physical machine, to just 4 instances – that can handle double the traffic!
eBay launched ql.io, a web query language for HTTP APIs, which uses Node.js as the runtime stack. They were able to tune a regular developer-quality Ubuntu workstation to handle more than 120,000 active connections per node.js process, with each connection consuming about 2kB memory!
So, what is this Node.js and why has it been the primary choice of the big shots?
Node.js is a server-side development framework that makes use of event-driven non-blocking I/O and prides itself on:
- being able to bridge the gap between the front-end and server-side architectures.
- supporting code reuse at every level – client, server and even database (MongoDB).
Node.js is open-source and has a strong and passionate community. It is the second most Popular Starred repository on Github. NPM is the node.js package manager, and as the name implies – is used to install node programs. There are thousands of developers contributing modules to NPM and providing incremental updates and additions to Node.
Though Node.js is relatively new – it has some awesome frameworks that help reduce the load to a great extent. Though I have been involved in Node.js app development for a while now, but I’m still not capable of keeping up with the latest and greatest additions to the Node family myself. I have primarily used Connect, Express and Socket.io. To see a list of some renowned and widely-accepted frameworks, visit this link.
Performance and scalability
Node’s specialty is high-concurrency, real-time applications: anything where you need to have a large number of users connected at the same time. But Node can be used to serve any website or application, and it will do so with its characteristic speed and efficiency.
Node.js allows you to tune page rendering between client and server based on the network. Server-side rendering is no longer fiction! Maybe you are already using frameworks like YUI or jQuery to generate views in the front-end based on the JSON/XML data received from the backend. Now, you can use the EXACT same code to do rendering on the server. YUI3 is now available full-fledged for Node.js, thanks to enormous amount of time put in by Dav Glass! To know more about how can you optimize client and server side rendering, watch this video by Matt Taylor.
It’s possible for NodeJS to interface with the various push notification systems available on each platform, or to use something like SocketIO to provide real-time communications between client and server. This article is a particularly good read on the implementation of a push notification server Node.js and a simple push notification server.
There are tonnes of resources to learn Node.js. I’ll list a few which will help you get started:
- Node Beginner Book
- Best Resources to learn Node.js | Quora
Node.js has not reached v1.0 yet – but is surprisingly very stable and widely adopted. As mentioned earlier, Node.js is not the only tool in the market to that does non-blocking I/O. There are quite a few – but what differentiates Node from the rest that it has a vibrant community which has been working around asynchronous, event-driven application logic, right from day one.
What I would want people to do is to go give Node.js a fair try! Talk to me if you face issues, be active in the Node IRC channel. Talk to people who have already done it. Node.js is a relatively young server platform and definitely isn’t a silver bullet to replace all existing server platforms. If you need a light weight, efficient and scalable platform to provide services for your mobile app, Node.js will likely be a great choice.
Let me know your thoughts in the comments section below. Happy Node-ing!