Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Why Node.js beats Java and .Net for Web, mobile, and IoT apps

Rick Snyder | Aug. 26, 2015
Speed, scalability, productivity, and developer politics all played a role in AnyPresence’s selection of Node.js for its enterprise development platform.

A couple of years ago, the development team at AnyPresence was tasked with implementing a back-end server API generator for a large customer that wasn’t comfortable using Ruby on Rails in production and preferred an option in the Java ecosystem. To meet this requirement, the AnyPresence platform team invested a significant amount of time implementing a Java version of the generator in the Play framework. However, it was taking too long to implement features to match what was already available in the Rails version, so the team eventually started to look at alternative frameworks.

That search ultimately led us to adopt Node.js and Sails.js, which is an MVC framework for Node.js. This article attempts to explain the reasoning behind these choices.

Problem No. 1: Java, .Net, or Node.js?

As an enterprise dev platform for Web, mobile, and IoT apps, AnyPresence needed a secure, scalable, and well-supported development framework and runtime environment that could be used in large-scale production scenarios. Java and Microsoft .Net were the obvious options. Given Java’s rock-solid foundation, IDE support, threading capabilities, debugging features, and vast array of libraries, it is still regarded by many as king in the world of programming. But Java has its downsides, primarily related to speed of development and the burden of legacy overhead, making it a questionable choice when it comes to modern, streamlined Web app development.

Microsoft .Net also has a huge following in the enterprise, but adopting .Net would require picking a specific .Net language like C#, and that would mean alienating the large swath of Java developers. Given these challenges, AnyPresence considered Node.js, which had a strong following with an impressive amount of documentation, tools, and best practices considering its age, and it was rapidly gaining adoption among enterprise IT organizations.

The rising popularity of Node.js is easy to understand, as more companies seek full-stack developers and more developers leverage existing skill sets for back-end server coding. Node.js allows for developers to write JavaScript on both the client side and the server side. That means you can use the similar patterns and -- in some cases -- the same libraries for both back-end and front-end development. That’s a big win when it comes to developer productivity, maintenance, and time to market.

With further research, the AnyPresence team concluded that Node.js was the best option for both technical and business reasons. The three main reasons:

  • Node.js is a politically neutral language. While philosophical debates and stubborn adherence to “standards” tend to drive a wedge between the Java and .Net camps, Node.js is quickly becoming the Switzerland of programming languages. Node.js is generally accepted and understood by both Java and .Net camps, whose developers are comfortable with JavaScript syntax and are able to deploy Node.js on both Unix and Windows infrastructures.
  • Node.js offers speed and a nonblocking I/O API. Node.js was created because concurrency is difficult in many server-side programming languages, and often leads to poor performance. Node.js provides an event-driven architecture and a nonblocking I/O API that optimizes an application's throughput and scalability. Developers write simple code and Node.js takes over. Node.js uses an event loop, instead of processes or threads, to scale. Callbacks are defined, and the server automatically enters the event loop at the end of the callback definition. Node.js exits the event loop when there are no further callbacks to be performed.
  • Node.js is ready for enterprise deployment. Node.js appeals to a wide range of the tech community because it has a reputation for scaling well, being secure, and being easy to learn. It’s not hard for a developer to pick up JavaScript and quickly become productive with it. There are many well-known organizations using Node.js in production, including PayPal, LinkedIn, Netflix, and the New York Times.


1  2  3  Next Page 

Sign up for CIO Asia eNewsletters.