Categories
Archives

From Java to Node – the PayPal story

One of the most prominent companies that use Node.js is PayPal, they were one of the first majors to give Node a chance, to take a risk on it and make a difference. In the beginning, node was just another language among many others, but it stood out, it grew through the people who used it and at PayPal it saw true proeminence.

Sneaking in

Node was a language to play with, to explore, nothing big, nothing important. A few companies started using it for different prototypes, PayPal started on the same path. People wanted to play with it so they got it through the door, slowly building different prototypes on it. The prototypes were fun, but more importantly, they were practical. Through some experimentation they found that they could copy a lot of code from their existent Java Stack to the Node Stack and back.

Reasons for the change

Node solved a problem for PayPal, it allowed them to do more, faster. Their existent model couldn’t catch up with existent trends, starting with the introduction of full stack developers. The biggest problem at PayPal was the barrier between the server and the browser. Node was a great solution from the beginning because it allowed them to write applications in JavaScript both for the browser and the server.  The prototype experience with Node should great promise, so naturally the next step was production.

Getting Node into production

Replacing Java on such a large scale was a risk, but past experiences gave them a lot of confidence – one of these experience proved that Node is faster and more efficient than Java. PayPal had a team of 5 engineers working on the PayPal wallet app using Java when Bill Scott, the senior director of user interface design, assigned a two person team to work on the same project using Node. In two months the two person team caught up with the five person team. That’s fast! Scott’s conclusion was “You can do more work in a shorter amount of time with half the people,” and he was right. The results spoke for themselves. The node app was written in 33 % fewer lines of code and with 40% less files.

This app was built in Kraken.js on express, using the templating engine Dust and the Java software used an internal framework that was mostly based on Spring.  The first production tests showed great promise and also brought peace of mind, as the node app responded to requests about 45% faster than the Java app, a very visible difference for the user.

This was the beginning that eventually led to a transition to Node of PaPal’s consumer facing apps.

The data was there, the performance was there and Node took over Java in PayPal.

Tweet

Categories
Archives

The Uber Node.js Story

Uber is an ambitious and innovating project, one that aims to make transportation as reliable as any other basic need in life, to make it accessible to everyone, everywhere. A tough task, a challenge! Uber needed a system that will keep running no matter what, and that’s why its engineers chose Node.js.

The Node.js Uber story starts actually at Joyent, the home of Node.  Curtis Chambers, one of the first employees at Uber and Amos Barreto, its Director of Engineering, way back when Uber was just a startup, went to Joyent for some node.js help. At Joyent they met Tom Croucher who is currently Uber Site Reliability Engineer. They wanted to use Node.js, who was still in its early stages for Uber, back in 2011. They took a huge change, it was risky to built and base almost an entire business on this new JavaScript backend thing that people kept talking about. Node.js was used for a few things, nothing very important, a bit here and there, and not at such a large scale.

Uber was one of the first big business that adopted Node at such a level, right from the start. Netflix and PayPal, both, big companies took the Node road, but they we’re already established companies when they made that change to Node.js from Java. Right now they’re running a older version of Node, 0.10. There are a few reasons why they went to Node and why node works so well for their business:

1 Node.js handles asynchronous I/O requests with a non-blocking, single-threaded event loop. It is particularly well-suited to distributed systems that make a lot of network requests.

“Node.js is particularly well-suited to writing systems that have all their state in memory”  Kris Kowal, Software Engineer at Uber.

2 Node.js—and JavaScript in general—s excellent for quick iteration; programs can be inspected and errors can be addressed on the fly without requiring a restart, so developers can publish and deploy new code constantly.

One of the things that makes Node.js uniquely suited to running in production is that you can inspect and change a program without restarting it. So very few other languages offer that capability. Not a lot of people seem to know that ability exists, but indeed you can inspect and even change your program while it’s running without restarting it.”

Kris Kowal, Software Engineer at Uber.

3 The active open source community continuously optimizes the technology; it gets better, all the time, practically on its own.

“By building on Node.js’s actively-developed, open-source system, we get the benefit of lots of people making the software better”

Kris Kowal, Software Engineer at Uber.

The amazing thing is, that even though they’re such a huge company, they invest in the community, cherishing it, at the last node Interactive they made available the Node.js systems that make Uber work basically, available for the community, which was great. You can check out Tom Crouchers presentation here.

Besides this they also created three pieces of software to keep their matching system running all the time at the massive scale required: Ringpop, TChannel, and Hyberbahn.

We’re going to talk a bit more about Ringpop and the other Uber made Node.js products.

Ringpop is an open-source Node.js library that brings application-layer sharding to many of their dispatching platform. It has 3 core features:  a membership protocol, a consistent hash ring and request forwarding. Here are a few more details about it:

  • Ringpop is an AP system, that trades consistency for availability, something very important for Uber

  • Ringpop is an embeddable module that’s included in each Node process.

  • Node instances gossip around a membership set. Once all the nodes agree who each other are, they can make lookup and forwarding decisions independently and efficiently.

  • Ringpop  is very scalable, you can add more processes and get more things done.

  • The gossip protocol is based on SWIM. A few improvements have been made to improve convergence time.

  • A list of members that are up are gossiped around. As more nodes are added it is scalable. The ‘S’ in SWIM is for scalable and really does work. It has scaled to thousands of nodes so far.

  • SWIM combines health checks with membership changes as part of the same protocol.

  • In a ringpop system there are all these Node processes containing ringpop modules. They gossip around the current membership.

  • Ringpop is built on Uber’s own RPC mechanism called TChannel.

  • It’s a bidirectional request/response protocol that was inspired by Twitter’s Finagle.

  • Uber is getting out of the HTTP and Json business. Everything is moving to Thrift over TChannel.

  • Ringpop is doing all its gossip over TChannel based persistent connections. These same persistent connections are used to fanout or forward application traffic.  TChannel  is also used to talk between services.

Source;

TChannel is a networking multiplexing and framing protocol for RPC. It uses a request/response model with out-of-order responses, where slow requests at the head of the line will not block subsequent faster requests. It also creates a high performance forwarding path for the existent requests .

Hyberbahn is a service-to service discovery and routing system. It allows Uber to adapt in real time in order to ensure user requests get where the need to go to be resolved, no matter what’s happening in the system. It’s elastic, massively distributed, and fault tolerant.

Source;

Uber means transportation that’s always available. This is their core value and as such they needed a system that scales quickly, also taking into account how fat their business is growing, doubling in size almost every six months. Uber is now doing over two million RPCs per second at peak across the Node.js fleet. They also wants to add 1000 engineers to their team this year to be able to sustain their companies growth so don’t forget to follow them.

This quote from Kris Kowal, Software Engineer at Uber sums up the Uber Node.js story very well:

“Somewhere in the world, someone needs to get where they need to go, and without the flexibility and reliability that Node.js provides that someone might be left thirsty for another transportation option.”

Tweet

Categories
Archives

8 jokes that will make you forget your code issues

Laughter is the best medicine, at least that’s what they say. I’m not sure how true it is, you might want to visit a doctor if you’re changing colours faster than a chameleon; but if you’re down in the dumps and you want to turn that frown upside down – a few giggles or a serious dose of hysterical laughter is just the right stuff. So here’s 8 jokes and something extra to loosen you up a bit.

1 Oh snap

2 But is it as fun?

3 *Checking out shoes*

4 The oldie

5 Bugs, bugs everywhere

6 You don’t tell me what to do! Or where to go!

7 Ba-Dum Tshh

8 Keep them beards growing

Bonus feature:

Tweet

Categories
Archives

A history of Node.js

With only 7 candles on the cake you’d think Node doesn’t have much history to it, but actually a lot of things can happen in 7 years. 2009  was a different world, the U.S. had its first black President, Avatar was  released and Johanna Sigurdardottir became Iceland’s first female Prime Minister. And of course, Node.js had its initial release.

Let’s go through everything year by year.

2009

  • An early preview of npm was released just a few months after Node

  • Ryan Dahl had the first presentation on Node.js at JSConf

2010

  • The initial release of npm (in January)

  • The express framework was released

  • Socked.io came to life

  • Ryan Dahl had the first Google talk about Node

2011

  • Npm 1.0 was released

  • One of the first books for Node.js beginners was released: The Node.js Beginner book by Manuel Kiessling.

  • 2 major companies started using Node.js: Linkedin and Uber

2012

  • This year Ryan Dahl left the Node.js project and Isaac Schlueter took on the gauntlet of moving Node forward. At this point in time, the Node.js project was still under the Joyent umbrella, and Ryan remained an employee there.

  • Hapi.js was released

2013

  • The initial concept of the MEAN stack was introduced by Valeri Karpov, a MongoDB developer.

  • Ghost, a node.js open source publishing platform was released

  • Paypal adopted Node, so did ebay (they both moved from Java)

2014

  • Node leadership changes hands again as TJ Fontaine takes over

  • Netflix takes the Node way

  • This was the year then the io.js project forked, the year Node divided. Io.js released several version in tandem with the original Node.js team. Opinions were divided and people went in different directions.

2015

  • A house divided cannot stand on itself, so in June of 2015 the Node.js Foundation was created and the io.js project reunited with the original node project. The foundation has several big name in its members, companies that support the foundation and its endeavours. It still remains and independent entity that works for the promotion and development of Node.js

  • 3 months after the Node Foundation was launched TJ Fontaine stepped down as the lead of the project

  • In September 2015 the Node.js and io.js combined in a single codebase with the release of Node 4.0. This was the original version 1.0 planned before the merger.

  • In 2015 a plan was outlined for constant and regular Node.js version updates. You can read more about it here.

  • The first Node Interactive conference took place

2016

  • Npm got to more than 200k users

  • The first Node Interactive Europe conference happened

  • Yarn was released

  • Node.js 6 is the latest LTS version

What other major events of Node do you consider worth mentioning?

Also, have a look at some the companies and startups that are currently using Node.js

Tweet

Categories
Archives

Stack Overflow Survey 2017 – let’s talk about Node.js

Stack Overflow recently released the data on their yearly developer survey. 64.000 developers, from 213 countries completed the survey in January. 57% of them completed the entire survey while 24% completed enough questions to being considered as well. In total they had 51.392 usable responses from: North America (13.717) , UK and Ireland (4740), France (1740), Germany, Austria, Switzerland (5221). The rest of Europe brought in 10757 responses, while Asia, Pacific and Australia brought in 11528, Africa 1249 and South America and Central America had 2098 responses. 155 chose not to identify with a region.

This is the fifth edition of the survey and also the fifth time that JavaScript conquered the title as the most commonly used programming language. This can only be good news for the Node community. SQL takes second place and Java third. Another breakthrough this year came for Python, it overtook PHP for the first time since the survey is conducted.

36,625 responses

In the Frameworks, Libraries, and Other Technologies section Node.js is on top again, followed by Angular, another JS based framework.

The survey also included a Technology Popularity Over Time section where you see the popularity of lack thereof of a given technology for the past 5 years.  Node.js went from 8% in 2013 to 26% in 2017.

JavaScript went from 57% to 62%, Python from 22% to 32% while other technologies like PHP decreased from 35% to 28%, Java from 42% to 39% and C++, from 28% to 22%.

A very interesting section of their survey is Most Loved, Dreaded, and Wanted Languages, not just statistics and facts, but also preferences.

For the second year in a row Rust won the most loved programming language title and Visual Basic (6), won the most dreaded programming language award. For the most wanted section, Python takes the crown, jumping from fourth last year, while JavaScript takes second place.

For the record this section implies that developers that are using a certain technology, love it, dread it, or want to use it.

The same principle applies to the Most Loved, Dreaded, and Wanted Frameworks, Libraries and Other Technologies section.

React wins first place and Node takes the silves on the loved leaderboard, Cordova “wins” the most Dreaded award and, * drum rolls please * Node.js takes the top of the Most Wanted section!

Here are a few more interesting facts from the survey:

  • Linux Desktop was the most loved platform.

  • Sharepoint was the most dreaded.

  • More developers wanted to work with Android this year than any other platform.

  • JavaScript is also the most popular language for web developers, Sysadmin/Devops, Data Scientist/Engineers and second favorite for desktop developers (behind SQL)

  • 53.3% of developers said remote options were a top priority.

  • 72.6%  of respondents identify as web developers

  • 88.6% of respondents were male

  • 90% say they are at least partially self-taught.

Check out the full survey on Stack Overflow.

Tweet