Use case of JavaScript in Microservices Industry

Before Knowing the use case, let us understand

What is Javascript?

It is a programming language used both on the client-side and server-side that allows you to make web pages interactive. The browser can understand only one language(i.e Javascript). Javascript can be embedded in both HTML and CSS

Types of Javascript frameworks:

  • React JS
  • Angular
  • Vue JS
  • jQuery.
  • Backbone JS
  • Node Js
  • Ember JS
  • Meteor

What is Microservices ?

It is an architectural design for building a distributed application using containers. This architecture allows for each service to scale or update without disrupting other services in the application

(Monolithic vs Microservice)

Examples of microservices industry:

Node.js and Microservices: A Match Made in Heaven

Node.js became the go-to technology in the past years for both startups and enterprises who decided to embrace microservices. Why did that happen? What is so appealing about using Node?

Well, some argue that Node.js increased the productivity of their teams, and some will say their application became blazing fast or that their developers are happier with Node.

In fact, all of these claims are true, here’s why:

Productivity: The package manager for Node.js, npm has an incredible amount of modules that can be used instantly, which saves a lot of development effort. Also, as Node.js applications are written using JavaScript, front-end developers can easily understand what is going on, and make changes if necessary. Since developers can use the same language on the entire stack and the very same modules in the frontend and in the backend, an incredible amount of time can be saved.

Performance: Node.js is one of the best solutions for creating high-performance, real-time web applications, thanks to its non-blocking, event-driven I/O model. Combined with a microservice-based application, it can handle an extreme amount of load with low response times. By properly utilizing microservices and Node.js, it’s possible to handle the same load with only 10 percent of the hardware according to GoDaddy’s Senior Software Engineer, Stephen Commisso.

Developer Happiness: Node.js is spreading like an unstoppable virus with its 3.5 million users and 100% annual growth rate according to the Node Foundation. Its module system — npm — is much more popular and grows significantly faster than the package managers for other languages often used in an enterprise environment. Why? Because developers love it. It’s also worth noticing that Node.js is highly favored amongst the next generation developers, who don’t really want to work with statically typed languages like #C or Java anymore.

(Node JS VS Other languages)

PayPal Got Rid of its Monolith for Good with NodeJS and Microservices architecture

The migration from a monolithic Java stack to a microservices-based Node environment at Paypal started in early 2013 with a prototype project. At that time, their engineering teams were separated into groups developing the browser layer (HTML, CSS, JS) and the application layer. After introducing full-stack engineers, the artificial boundary between browsers and servers started to dissolve, according to Jeff Harrell, the leader of UI Engineering Architecture.

Since Node performed well as a prototyping platform, PayPal decided to try it out as the platform of their account overview page, one of their most trafficked app, while keeping the Java application as a fall back option in case anything goes wrong.

The results of the migration were astounding for PayPal engineering. Their Node.js app was built twice as fast with fewer people, meanwhile, the code consisted of 33 percent fewer lines and 40 percent fewer files. Regarding performance, expectations were also met: A single core Node app was able to handle double rps as the five core Java app. Response time decreased 35 percent, and pages were served 200ms faster. From this point, there was no turning back.

It’s also worth noticing that Node.js on its own is not the solely responsible for the success — the transition wouldn’t be so successful without microservices. According to Sameera Rao, senior business products engineering manager at PayPal: “Node.js and an all-Javascript development stack helped PayPal bring efficiencies in engineering and helped rethink and reboot product, design, and operational thinking.”

When PayPal worked with a monolithic architecture, one app did everything. Duplications were common, while teams copy-pasted and tweaked code all the time — and development was like working on an assembly line. Not much was being done.

After moving to a microservice mindset, they were able to modularize their stack, and global teams could roll out new features in a much faster way. For this, they created an open source model and a core GitHub repository with the proper guidelines. By organizing better how the teams worked and how the code was written, PayPal was able to scale Node.js for their global organization in a way that multiple teams were able to work on the same project with ease.

Netflix Reduced its 40 Mins Startup Time With Node

Back in 2013, Netflix ran a large monolithic application with 40 minutes long startup times and really slow builds according to Kim Trott, director of UI platform engineering. Developing this way didn’t enable them to be productive enough and innovate quickly. With Java on the server and JavaScript on the client, everything had to be written twice.

The solution was to simplify their stack, move the website to a single page application and choose a common language to write the same code: Node.js, with the philosophy of write it once, run it everywhere. They were also able to solve problems with vertical scaling, by leveraging Docker and Node to serve as data access layers to their monolithic JVM based system which accesses and mutates data.

This is Certain use cases that how Javascript used in Microservices Industries…

Hope u liked

Happy learning :)