Five Enterprise Apps Using Node.js Under the Hood

August 5, 2020

Ten years ago, Node.js was considered to be on the bleeding edge of technology, the domain of the curious and the bold. Today, enterprise-level organizations like Netflix, PayPal, and NASA are implementing the server-side JavaScript runtime for two primary reasons: speed and scale.

In this post, we take a look at five different enterprise apps using Node.js under the hood to understand why it has become the new standard for enterprise applications.

Netflix

As of April 2020, the world’s largest streaming service had over 193 million paid subscriptions worldwide, including 73M in the US. Its online streaming library includes movies and TV shows, originals and acquisitions, and it is available in more than 190 countries.

Netflix started to use Node.js back in 2013. At the time, as a single Java monolithic application, it was struggling with 40-minute startup times, slow builds, huge developer machines and the need for developers to context switch and write the same lines of code twice, for server and client sides separately (they were using Java on the server side and JavaScript on the client side).

According to Kim Trott, Director, Runtime Engineering at Netflix, this state was “affecting our ability to be productive and move quickly and be able to rapidly innovate and build out all the A/B testing that we do.” They found they were having to do many things twice: write code, debug, data access, render, etc.

In an interview with Node.js, Yunong Xiao, Principal Engineer at Netflix, boiled down its choice to go with Node.js to “three big reasons”:

1. A common language

“JavaScript is the lingua franca of the web today… so that’s a big help in its uptake because folks already know the language so it makes it easy for them to learn the run-time.”

2. Performance

“For us with such a big shop at such a big scale, the more performant something is, the better we are at controlling cost and saving cost on the infrastructure.”

By moving its website to a single-page application (SPA), Netflix saw load times go down to sub 60 seconds.

3. Modules Ecosystem

“We don’t want to have to invest in reinventing the wheel every time so if there’s a great suite of modules that help us get our work done, that’s a huge boon.”

The rich module ecosystem around Node.js, much of it open source and available on npm was attractive to the Netflix team. The fact it is focused on the UI needs and UI frameworks and libraries was also appealing (and different to the Java ecosystem).

PayPal

PayPal has over 325 million active accounts worldwide, allowing users to interact virtually with each other, make payments and issue money transfers without the need for debit or credit card disclosure.

PayPal was the host of the inaugural NodeDay in 2014, being one of the first major enterprises to adopt the runtime. In a PayPal Engineering blog post on the decision to move to Node.js for their application platform, they admit they “slipped Node.js in the door as a prototyping platform.” Once “it proved extremely proficient”, they decided to give it a go on production and moved all their consumer-facing web applications from Java to JavaScript and Node.js.

Historically, PayPal’s engineering teams were segmented into two groups – people who coded for the frontend (using HTML, CSS and JS) and people who coded for the backend (using Java). There was a lack of easy communication between the two: “the primary blocker at PayPal has always been the artificial boundary we established between the browser and server.”

As at Netflix, the adoption of Node.js and the ability to use JS to write browser and server-side applications allowed PayPal to unify its engineering disciplines into one combined team of full-stack engineers.

Their first adopter of Node.js in production “wasn’t a minor application” – it was the PayPal Account Overview page, one of the most heavily trafficked apps on the website. They decided to mitigate the risk by building an equivalent Java application in parallel. This set the playing field for an interesting comparison between the two, which came out strongly in Node.js’ favor:

  • The Node.js application was built twice as quickly with fewer engineers working on it;
  • There were 33% fewer lines of code;
  • There were 40% fewer files;
  • Requests per second in Node.js was double the Java application;
  • They saw a 35% decrease time in the average response time for the same page; and
  • Pages were served 200ms faster with Node.js.

Microsoft

Over recent years, Microsoft has undergone a substantial change to its business model, embracing digital transformation, and encouraging its customers to do the same. It still supports and sells computer software, consumer electronics, personal computers, and related services, but its core business is now about cloud, SaaS and PaaS, as well as forays into AI and ML

Microsoft was another early adopter of Node.js, implementing a native Windows version in 2011. In a talk at NodeDay 2018 on Microsoft’s digital transformation journey with Node.js, Chris Dias, Principal Program Manager at Microsoft, linked its continued success at the company to two “essential KPIs” for the success of the overall company:

  1. Productivity - Node.js “is a very productive stack”, says Dias. “The first time I sat down and wrote a small backend system in Node, I was shocked by how productive I was and how much more capability I could get done compared to any other technology stack at the time.”
  2. Revenue – “Being able to bring a solution quicker to market with more features will help grow your revenue”, says Dias.

In a discussion with Open Source Blog, John Papa, then Microsoft technical evangelist, listed various additional factors behind Microsoft’s move to Node.js, including:

  • The engaged and welcoming community around Node.js;
  • The ability to add on what you want using middleware, which makes it attractive to JS frameworks such as Vue, React, Angular, which each have their own CLIs that run on Node.js, helping developers build, generate and test;
  • The ecosystem value that npm provides – according to Papa, it’s “a huge influence over why Node.js has been so successful” as the number of packages available allow you to do “just about anything you need or want to do.”
  • Using Node.js eliminates the need for context switching – constantly working in the same technology, he says, “keeps you in the same mindset.” Adding, “anybody who’s ever started working on something involved or complex, you know how important it is to not get pulled away from it and then back in. Keeping your context consistent is a huge reason why full-stack JavaScript has been successful.”

LinkedIn

LinkedIn has over 700 million global users in its business-focused social network in over 200 countries and territories worldwide. It too was an early large-scale user of Node.js. In fact, LinkedIn first adopted Node.js when it was barely a year old.

The engineering team was drawn to Node.js to rebuild its core mobile services when they were unable to scale Ruby on Rails, and they had run into trouble working with microconnections in the mobile app.

They decided to go with Node.js for the mobile app’s backend and the switch achieved impressive results (“thinner, lighter, faster”, according to Kiran Prasad, Senior Director of Mobile Engineering at LinkedIn). These included:

  • Much better performance – app running up to 20x faster
  • Using a fraction of the resources on the server-side – much smaller memory footprint
  • The move to an asynchronous evented system “enabled us to move to a model where the client makes a single request for a page” as “the code was simplified and we moved to stateless servers” (Deepank Gupta, Senior Software Engineer)
  • Improved unity between frontend and backend mobile teams – to the extent they were combined into a single unit
  • The engineers felt comfortable coding in JavaScript since it is a language used so widely

Another major improvement they saw was in terms of developer productivity. Development time in Node.js was very fast. “It was fast by all standards,” LinkedIn’s mobile development lead Kiran Prasad told VentureBeat. “I’ve worked at startups and big companies like Yahoo, and yeah, it was fast.” It only took two to three hours to write the Node.js prototype. He added that it was also fast because it used HTML5 in the web app and the engineering team were able to reuse much of the same code in the native applications for iOS and Android. This allowed the LinkedIn developers to focus more on application development as opposed to firefighting.

Walmart

As one of the world’s biggest retailers, Walmart had an operating income of around $20.6 billion in 2020. Its CEO, Doug MacMillan, has described it not just as a retailer with stores located within ten miles of 90% of the US population, but a technology and “an innovation company.” During 2018, the retailer spent $11.7 billion in technology investment, making it the third largest IT spender in the world behind Amazon and Alphabet.

Like most of the other enterprises listed here, Walmart was one of the forefront users of Node.js.

Early adoption efforts included:

  • The hapi framework, initially developed to handle the scale of Black Friday; and
  • Electrode, a platform for building universal React/Node.js applications with a standardized structure, best practices and modern tech baked in. Electrode accelerated the use of Node.js within Walmart Labs, and now powers most of the Walmart eCommerce site.

Walmart Labs decided to make a number of adaptations to Node.js, while implementing Electrode, including:

  • Developing a new approach to allow teams to deploy any version at any time
  • Creating a zip artifact of the application with settings manifest built-in, pushed to Walmart’s internal Nexus repository

As Walmart migrated its web applications to Node.js, engineers found its own open-source product, OneOps, to be “the natural choice to host our platform.” Walmart uses OneOps to implement hosting, deployment and continuous integration (CI) for its Node.js applications.

Walmart also turned to Node.js for its mobile applications. Ben Galbraith, VP for mobile engineering, said the company did so because they wanted to create “a website that would be rich and dynamic… on devices that weren’t too powerful.”

On its re-engineered Node-powered mobile app, all front-end code is executed on the back end. Don Almaer, VP for Mobile Architecture, says, “We rely on services all over the world. We do not control all of these services. Node allows us to front all these services… and scale up very nicely. It’s perfect for what we’re doing in mobile.”

Why has Node.js become the standard for Enterprise Applications?

Other enterprise companies that have adopted Node.js include GoDaddy, IBM, eBay, Twitter, Yahoo! and Groupon.

These are the main reasons why Node.js has become so popular for enterprises:

  • Highly performant (one of the most efficient server-side frameworks);
  • Powered by Google’s V8 JS engine, which enforces runtime speed;
  • Scales easily;
  • Written in JavaScript:
    • No more context switching between languages when writing across the stack;
    • JS benefits from improvements in language and runtime design compared to traditional backend languages such as Python and PHP;
    • Many popular languages compile/convert into JS, so you can use TypeScript, Scala, LiveScript, etc.;
  • Software development is fast;
  • Event-driven – a strong solution for heavy I/O operations, data flow, and multiple connection requests;
  • Portability – available across all major operating systems, and well-supported by many web hosting providers;
  • npm provides access to hundreds of thousands of reusable packages to extend Node.js and create feature-rich enterprise web applications;
  • Open source – there are nearly 3,000 contributors to the Node.js runtime alone; and
  • It has a robust, engaged and welcoming community.