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.
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.
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
“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 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.
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.
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:
- 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.”
- 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.”
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
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.
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;
- 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.