DEV Community

Cover image for Use Case of JavaScript in today's industry.
bhat sumair
bhat sumair

Posted on

Use Case of JavaScript in today's industry.

Uber and javascript
Uber needs to handle loads of data in real time. They have millions of requests coming in continuously, and that’s not just hits on a page. Uber needs to track driver locations, rider locations, and incoming ride requests. It has to seamlessly sort that data and match riders as fast as possible.

All of that plays to NodeJS’s and JavaScript’s strengths. Node is designed to handle requests and hand off data quickly. It’s asynchronous capabilities are a huge part of that. Node is central to Uber’s user facing stack for just that reason.

Uber’s core trip execution engine was originally written in Node.js because of its asynchronous primitives and simple, single-threaded processing. (In fact, we were one of the first two companies to deploy Node.js in production.) Node.js gives us the ability to manage large quantities of concurrent connections. We’ve now written many services in Go, and this number continues to increase. We like Go for its concurrency, efficiency, and type-safe operations.
The frontline API for our mobile apps consists of over 600 stateless endpoints that join together multiple services. It routes incoming requests from our mobile clients to other APIs or services. It’s all written in Node.js
Highly Available, Self-Healing, Persistent
Having to support the highest availability demands, the Marketplace stack must receive and execute in real time. Even brief interruptions in this area have major consequences for our users and our business. Much of Marketplace’s stack was built by and for Marketplace engineers first.
Ringpop, a library for building cooperative distributed systems, solved some of Marketplace’s problems before its adoption in other teams at Uber and beyond. It gives the high-availability, partition-tolerant properties of distributed databases like DynamoDB or Riak to developers at the application level.
The systems that handle pings from riders and drivers in real-time and then match them are written in Node.js and Go. These teams use Ringpop and Sevnup for cooperation and shifting of object ownership when a node in a hashring goes down, or when another node takes ownership of the keyspace. Riak is their distributed database. Redis provides caching.
Seeing and Using Data
A group within Marketplace turns Marketplace data into useful visualizations to help the team understand and observe the state of the world. We use JavaScript for web front-end applications. React+Flux, D3, and Mapbox are the libraries and frameworks behind this group. For the back end, it’s the same Node.js server used by Uber’s web engineers.

Latest comments (0)