USE-CASE OF JavaScript in Walmart

Awais Junaid
4 min readSep 5, 2021

Task 07 👨🏻‍💻Summer Program 2021

Task Description 📄
Javascript Integration with Docker

Task 7.2

📌 Write a blog explaining the usecase of javascript in any of your favorite industries.

JavaScript is a lightweight, open-source and cross-platform programming. It is designed for creating network-centric applications. It is complementary to and integrated with Java. It is used to add interactivity to a website. Examples can be taken of games or in the behavior of responses when buttons are pressed or with data entry on forms, with dynamic styling, with animation. In essence, it can be said that javascript adds functionality or dynamic nature to a website. Its usage has now extended to mobile app development, desktop app development, and game development. There are many beneficial Javascript frameworks and libraries available:

  • Angular
  • React
  • jQuery
  • Vue.js
  • Node.js

Over the years, the popularity and demand for JavaScript have remained high.

Walmart

Walmart is one of the largest retailers across the globe, their adaptation to changing technology has always been a positive highlight for them, Initially, they used Java but to operate in a small power machine i.e, mobile phone they shifted to JavaScript and used Node.js for the backend. Walmart can serve some very sophisticated features to mobile users on the client-side using Node. It’s saving mobile shoppers a ton of time by customizing content based on device type and browser capabilities.

Walmart Strives to be an Online Retail Leader with Node.js

Walmart needed to improve its business. That’s not normally said about an international mega-corporation that made $482 billion in revenue last fiscal year, but Walmart has set its sights on becoming the world’s largest online retailer.

Walmart.com currently offers more than 23 million items for sale, and is rapidly expanding; earlier this year the company announced it’s inviting retail partners and smaller vendors to sell on the site.

The company already sees close to 20,000 hits per second on its website and mobile app during the holiday season, so it needs to build a fast, reliable, usable and bulletproof ecommerce system to reach its goals of becoming a leader in the online retail space.

That’s why it’s rebuilding Walmart.com with Node.js.

The core strengths that make Node.js a good fit for Walmart and other ecommerce sites include:

  • Keep Content Consistently Fresh with Node.js: Walmart’s system takes advantage of the asynchronous I/O that Node.js famous for and makes use of its single-threaded event loop model to efficiently handle multiple concurrent request to update it site.
  • Node.js Keeps Walmart Top of Mind: Node.js helps Walmart.com keep its content in front of Google and other search indexing robots with the help or React.js
  • Using Available Talent as Full-Stack Developers: Node.js creates universal JavaScript, allowing Walmart to take full advantage of its talented JavaScript developers in all areas of its business.

Walmart: Agility Enabled with React.js, Node.js

When Walmart wanted to upgrade its online web site and mobile platform, it needed to marshal its IT resources as skillfully as possible to keep up with the likes of Amazon.com, Target and CostCo.

Alexander Grigoryan, Walmart senior director of software engineering, application platform and online grocery, knew that he would need to meet multiple requirements simultaneously.

The company’s monolithic Java ecommerce application was no longer the right solution. The system needed to become a set of modules that could be updated separately. The modules would need to be high performance and be scalable to match Walmart’s fluctuating consumer demand. And the site had to become more comprehensible to search engines.

To some extent, Grigoryan’s predecessors thought they were accomplishing many of these ends when in a preceding move they switched the consumer facing side of the web site to a Handlebars.js and Backbone.js JavaScript code base. Backbone in particular was supposed to support the notion of single page applications, where a Walmart customer could make choices in what he was looking at in the browser window and the page didn’t need to stage a full refresh with each consumer click.

But there were still issues of scalability, plus availability to the indexing mechanisms of Google, Microsoft Bing and other search engines. Walmart needed to switch to server-side rendering of JavaScript into HTML, instead of sending JavaScript to the client where the client did the transformation. The web-crawling bots gathering site information for search engines extract HTML but not JavaScript.

As a primary building block, Grigoryan and his development staff selected an emerging tool, open source React.js, a JavaScript library for building user interfaces, to replace Handlebars.js and Backbone.js. Like them, React worked with the Node.js version of JavaScript. But unlike them, it transformed the JavaScript into HTML before sending it to the client.

“The unique requirement of Walmart is that you have to be search engine-savvy,” said Grigoryan.

Conclusion:

Over the last decade, JavaScript has become, by far, the most popular language for mobile application development. “We believe that Node.js is a programming mega-event on the scale of Java or Ruby on Rails. It is not merely a new way of expressing existing ideas, but rather a new way of thinking about how software systems should be built.”

--

--