Why LinkedIn's Mobile Developers Dumped Ruby For Node.jsWhy LinkedIn's Mobile Developers Dumped Ruby For Node.js

Node.js, a server-side programming platform for JavaScript, available as open source, is part of the story behind a performance boost for LinkedIn's most recent iPhone app.

David F Carr, Editor, information Government/Healthcare

January 23, 2012

4 Min Read
information logo in a gray background | information

How Starbucks Taps 7 Tech Trends

How Starbucks Taps 7 Tech Trends


How Starbucks Taps 7 Tech Trends (click image for larger view and for slideshow)

The developer team behind LinkedIn's mobile apps has been getting in the mode of Node.js and seeing great performance improvements as a result.

Kiran Prasad, director of engineering for mobile at LinkedIn, said Node.js has become his group's standard for front-end programming and is likely to start infiltrating other projects, including those targeted at PC browsers. "I don't think we'll go through and rewrite everything from scratch because that's just not time-effective, but we're definitely moving toward Node," he said.

Node.js is a server-side programming platform for JavaScript, available as open source with the support of Joyent. It's recently been incorporated into Yahoo's Cocktails suite of Web frameworks and is supported by VMware's Cloud Foundry development platform.

[Tracking the LinkedIn APIs? See LinkedIn Groups Widgets Headed For Apps, Sites]

At LinkedIn, a switch from Ruby on Rails to Node.js was part of the story of how the developers boosted the performance of the new iPhone app that came out over the summer, Prasad said. The performance of a mobile app is often determined less by the performance of the code executing on the device than by the latency of connections back to a server--particularly when the app must make multiple requests of the server, he said.

With Node.js, it's possible to achieve better performance by keeping the same connection open across multiple requests, Prasad said. Other server programming environments tend to discourage keeping a large number of connections open because each one requires its own process and consumes computing resources, he said. Node.js uses an event-driven programming model that allows it to handle many open connections without running out of resources. As a result, LinkedIn is able to deliver much faster performance on many fewer servers, saving money and making users happier at the same time, said Prasad.

While Node.js is not the right answer for processor-intensive data analytics, it is a great solution for most front-end engineering tasks--programs that essentially do heavy string manipulation to generate HTML to be sent to the browser, often personalized with input from multiple back-end systems, Prasad said.

"All user experience, mobile or on the Web, in general is evented by nature – it's driven by the user touching something or taking some action," Prasad said. JavaScript and AJAX programming tend to be built around events for that nature, but many of the server-side languages for Web development such as PHP follow a more procedural model of doing things one at a time in a predefined order, he said, whereas Node.js makes server-side programming more like coding for the browser or a mobile client.

The Web and mobile development environments are converging around HTML5, he noted, adding that the LinkedIn iPhone app is actually "about 80% Web-based, and it's designed so you can't tell which parts are Web and which are native."

Another reason Node.js is making great performance gains is that it runs on the same V8 JavaScript Engine used in Google Chrome and therefore benefits from work that Google and other big companies are pouring into improving JavaScript performance on the browser.

The LinkedIn engineering group has taken to enthusiastically blogging about Node.js and how to maximize Node.js performance.

One of the biggest benefits is that JavaScript developers who previously were not comfortable with server-side programming now can work in both realms, Prasad said. "We don't really have client developers and server developers anymore --we just have developers." One reason LinkedIn is talking up the technology is it wants developers to know "if you're interested in this stuff, or you have experience with this stuff, you should come work here," he said.

Follow David F. Carr on Twitter @davidfcarr. The BrainYard is @thebyard

Meet top cloud computing technology companies in Cloud Connect's ever-growing Expo Hall, and learn about the latest cloud services, applications and platforms. It happens in Santa Clara, Calif., Feb. 13-16. Sign up now with Priority Code CPMWCC18 for a free Expo Pass or $100 off our conference passes.

Read more about:

20122012

About the Author

David F Carr

Editor, information Government/Healthcare

David F. Carr oversees information's coverage of government and healthcare IT. He previously led coverage of social business and education technologies and continues to contribute in those areas. He is the editor of Social Collaboration for Dummies (Wiley, Oct. 2013) and was the social business track chair for UBM's E2 conference in 2012 and 2013. He is a frequent speaker and panel moderator at industry events. David is a former Technology Editor of Baseline Magazine and Internet World magazine and has freelanced for publications including CIO Magazine, CIO Insight, and Defense Systems. He has also worked as a web consultant and is the author of several WordPress plugins, including Facebook Tab Manager and RSVPMaker. David works from a home office in Coral Springs, Florida. Contact him at [email protected]and follow him at @davidfcarr.

Never Miss a Beat: Get a snapshot of the issues affecting the IT industry straight to your inbox.

You May Also Like


More Insights