JavaScript and various Use-cases
What is JavaScript?
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side scripts to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.
JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with the name LiveScript. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.

How it is used?
Let’s discuss the uses of JavaScript. Some of the uses of JavaScript are representing in the following image:

As Web Applications:

As day-by-day there is a continuous improvement in the browsers, so JavaScript gained popularity for making robust web applications. We can understand it by taking the example of Google Maps. In Maps user just requires to click and drag the mouse; the details are visible just by a click. There is a use of JavaScript behind these concepts.
In Web Development:

JavaScript is mostly used by all websites for the purpose of validation. In addition to validations, it supports external applications like PDF documents, running widgets, supporting flash applications, etc. It can also load content into a document whenever the user requires it without even reloading the entire page.
In Mobile Applications:

Now a day’s mobile devices are broadly used for accessing the internet. Using JavaScript, we can also build an application for non-web contexts. The features and uses of JavaScript make it a powerful tool for creating mobile applications. React Native is the widely used JavaScript framework for creating mobile applications. Using React Native, we can build mobile applications for different operating systems. We do not require writing different codes for the iOS and Android operating systems. We only need to write it once and run it on different platforms.
In Game Development:

JavaScript is also used for creating games. It has various libraries and frameworks for creating a game. The game can either be 2D or 3D. Some JavaScript game engines such as PhysicsJS, Pixi.js help us to create a web game. We can also use the WebGL (web graphics library), which is the JavaScript API to render 2D and 3D images on browsers.
Node.Js

Node.js is an open-source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux. It also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.
Why the companies use Node.js?
Node.js solves a list of production challenges for top organizations. Some are platform-related, while others are focused on resource utilization. Across the board, Netflix, Paypal, Linkedin, all have admitted to loading-time savings of up to 60% as reported by Hackernoon.
Speedtest.net, a popular tool for benchmarking internet speed, is itself using Node.js. Amongst others, better developer productivity, lower development cost, and higher app performance are the top reasons why companies use node.js apps.
Citibank

Citibank is a leading global bank with nearly 2.5 thousand branches spread across 19 countries. It was already a part of the Javascript-based technology ecosystem. However, recently, they onboarded Hapi.js, one of the Node.js frameworks. This move came after Walmart’s success with Hapi.js and Node; and the fact that it was befitting with their already existing tech stack.
- As Citibank shifted towards cloud computing, they needed something that fits well with modern-day massive distributed computing like docker, VMs, platforms in services and clouds, etc.
- Citibank needed a strong backend service, and Node.js aligned perfectly with its existing technological stack.
- Node.js is known to be handy for mobile protocols like messaging, webs, and different integrations.
- By implementing Node.js, the Citibank team was able to develop many plugins for their web apps.
- With the use of NTLM authentication of Node.js, they were able to make the authentication secure and straightforward.
- By leveraging Nginx direct delivery of Nodejs, Citibank achieved 50% lower latency.
Medium
Medium is a Content and Blogging platform, with about 25 million monthly unique users. It’s one of the few companies that use Node.js and AWS right from the beginning.
- Medium needed a Javascript runtime, as most of its web front-end is in React.js. There was a need to maintain platform uniformity, which accelerates development.
- Medium had around 7.5 million posts in 2016, which demonstrates its requirement for big data management with minimum server load.
- As Medium offered a web-based text editor for blog post publishing, it had to uphold the performance standards for its expanding user base.
- Loading time of mere 2.7 seconds even with large images and content processing.
- Node.js implementation made it easy to route images to GraphicsMagick for quicker processing.
- The Medium text editor leverages Node.js for making server calls from the front-end. Node.js provides for a smooth transition, enhancing the user experience for the publishers.
Uber

Uber is one of the very first large-scale adopters of Node.js in production. Uber has a distributed architecture with a large number of modules that communicate with each other via APIs. Since it processes millions of concurrent requests, node.js was a perfect fit for them.
Several components of the Uber Mobile App use Node.js for critical operations such as trip execution and connecting 600+ APIs. Uber is shifting some components to Go, but Node.js continues to play an essential role in its technology stack.
- Uber needed a real-time and speedy API-driven architecture that could process millions of connections at a time.
- Uber uses several fragmented microservices to power its infrastructure, which demands a backend that could band things together.
- The company wanted to run advanced analytics on the vast amount of data generated by its platform, which could be best done when services interact correctly.
Uber was able to create a reliable, self-healing, distributed environment for Web and Mobile App which heavily relies on Node.js.
- The component that is responsible for executing trips is built on Node.js. It benefits from the asynchronous and single-threaded event loop of Node.js, making it highly reliable.
- Uber can process a large number of user requests.
- Uber’s API ecosystem has over 600 stateless endpoints that are all written in Node.js, which increases connectivity and reduces management overheads.

Linkedin, the world’s largest professional network, has more than 690 million users. It is also one of the biggest apps that deploy Node.js in production.
LinkedIn, for a long time, was working on Ruby on Rails before switching to Node.js. This decision was primarily based on increasing app performance and decreasing resource usage. By employing Node.js as their backend, they moved from synchronous to asynchronous request processing, which offers much faster interface loading speeds.
- The server took too much load whenever there was an increase in Traffic.
- Linkedin couldn’t process multiple concurrent requests with Ruby implementation.
- The Ruby App worked synchronously, making the pages heavier to load.
Node.js app helped LinkedIn reduce its resource usage and improved app performance.
- LinkedIn was able to reduce the machines used to host their app by a ratio of 10:1.
- The client and server both came under the Javascript regime, making it easier for development teams to handle the client-server interaction.
- The code was simplified across the board, making it more modular and less state-dependent.
In conclusion, if Node.js was an excellent fit for these companies, does that mean it will be an excellent fit for you? The short answer is — if you’re facing similar challenges as these companies, Node.js is a step in the right direction. The adoption of Node.js in production by big names ensures that it will continue to receive support, and will only grow into better technology.
This is why Node.js is a part of our tech stack for web applications that have Netflix-like performance needs or eBay-like scalability expectations.
Thank you for taking some precious time to read this article!
Feel free to ask any queries. Don’t forget to share this article with your fellow acquaintances. Follow me on LinkedIn using the link provided below: