How PayPal shifted to JavaScript?

Rahul Bhardwaj
3 min readJun 24, 2021

What is JavaScript?

JavaScript in simple terms is a web development language. It works with HTML and CSS to do the manipulative and interactive things rather than just showing the static things on the web page which is the work of HTML and CSS. CSS is used to make our page a little more creative and animated. But the things like what happens if someone press this or that button is taken care of by JavaScript.

PayPal

PayPal is an American company that provides online money transfer services across various countries. PayPal provides a quick and easy service and according to them you can:

  • Shop online in more than 200 countries and regions.
  • Send money securely to friends and family around the world.
  • Checkout quickly at hundreds of your favorite online stores.
  • Accept credit cards on your website.
  • Make donations to your favorite charity.
  • Set up an online shop and receive payments.
  • Use your credit card and earn rewards.

Providing more and more services means more work at the backend and as well as integrating it with the front end.

PayPal and JavaScript

Before 2013 PayPal was using Java as backend for the servers. The problem with that was there needed to be separate developers on the front end as well as in the backend that had to work together which was not an easier task. This earlier way of doing things was getting outdated with the rise of full-stack engineers.

Call them unicorns, but that’s what we want and the primary blocker at PayPal has always been the artificial boundary we established between the browser and server. — Jeff Harrell, director of Engineer at Paypal

PayPal shifted to using node.js from Java which allowed them to use JavaScript both as a front end language as well as backend.

Node.js helps us solve this by enabling both the browser and server applications to be written in JavaScript. It unifies our engineering specialties into one team which allows us to understand and react to our users’ needs at any level in the technology stack — Jeff Harrell

But what is Node.js?

Node.js is a server-side runtime environment for developing server-side and networking applications. Node.js also provides libraries for various JavaScript modules to simplify the development of web applications using Node.js to a great extent. It was built on the top of Google Chrome’s JavaScript Engine (V8) which is a runtime environment for serverless JavaScript functions.

PayPal’s first use of node.js in production was to serve the ‘Account Overview’ section to its users. The company hedged its bets by building an equivalent Java application in parallel.

It took two node.js engineers a few months to build the necessary software, almost half the time it took the five-man Java team, with the node.js app written in 33 percent fewer lines of code and built using 40 percent fewer files. It also took a few months to complete the one-time step of building the infrastructure to allow node.js to work with PayPal — adding support sessions, centralised logging and keystores.

Today almost all of the consumer-facing web apps are built on node.js.

--

--