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

25.08.2015
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.

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:

After AnyPresence decided on Node.js, we faced the question of which MVC framework to select. The top five we considered included Express.js, Meteor.js, Sail.js, Derby, and SocketStream. Ultimately, we chose Sails.js for its permissive license, robust community, flexibility, and readiness out of the box.

AnyPresence is architected with separation between design and runtime environments. The platform provides developers with full access to the source code across the entire application stack. Therefore, an ideal framework for us would have a permissive open source license based on MIT or BSD, enabling modification and distribution without sacrificing confidentiality of proprietary components. Sails.js comes with the MIT license.

Sails.js boasts a large and active community on GitHub, with thousands of people who either follow the repository or who have forked it. Such a large following indicates solid adoption from the community, which ensures a more mature and robust product.

While being very full-featured out of the box, Sails.js is based on Express.js, perhaps the most pervasive Node.js application framework in existence. As a benefit, any Express-based middleware can be plugged into Sails.js and utilized, giving Sails developers access to hundreds of open source packages that run on the Express.js platform.

Finally, because Sails.js comes with so many basic features out of the box, we immediately got many capabilities we wanted without having to reinvent anything. These included the following features:

There are many factors to consider when choosing a platform for your enterprise applications or customers. When AnyPresence debated the adoption of Java, .Net, or Node.js for our enterprise development platform, the decision wasn’t obvious or made overnight. In the end, the scalability, speed, enterprise readiness, and community support of Node.js swayed our engineers.

If you're building your next-generation applications -- especially APIs for mobile and Web integration in IoT -- or if you are creating something new that depends on those underlying services, Node.js is a runtime system that could very well work for you. It has certainly worked well for AnyPresence and its customers.

Rick Snyder is a software engineer and architect with more than 11 years of experience developing enterprise software. His particular interests include middleware, concurrency, scalability, and performance. Snyder is currently director of engineering at AnyPresence, an enterprise platform for digital transformation that enables API microservices, enterprise mobility, and IoT app ecosystem initiatives.

New Tech Forum provides a venue to explore and discuss emerging enterprise technology in unprecedented depth and breadth. The selection is subjective, based on our pick of the technologies we believe to be important and of greatest interest to InfoWorld readers. InfoWorld does not accept marketing collateral for publication and reserves the right to edit all contributed content. Send all inquiries to newtechforum@infoworld.com.

(www.infoworld.com)

By Rick Snyder

Zur Startseite