How GOJEK Manages 1 million Drivers With 12 Engineers (Part 1)

By Adithya Venkatesan

In Norse mythology, Yggdrasil is a gigantic mythical tree that connects the nine worlds of Norse cosmology. It’s a holy tree whose branches touch the heavens. The gods hold court beneath Yggdrasil — debating the fates of other gods, men and monsters. It’s the tree of life and the centre of everything in Norse mythology. In GOJEK, think of the `Allocations` team as this eternal green ash tree. Our multiple products rely on this team to assign drivers to complete orders.

The team cuts across products and services responsible for 1,000,000+ registered drivers on our platform.

And 12 engineers do this.

A similar ride-sharing equivalent has 300-odd people solving the same problem and still does fewer bookings. But how do they do it? This is their story.

On planet Earth, problems galore

When GOJEK started in 2010, it all began with a call centre. Customers would call a number, the call centre would ‘allocate’ a driver after looking at an Excel sheet of drivers in the roster. Our CEO Nadiem Makarim was the first person to test the app built for drivers and customers. As soon as a dummy order was created and Nadiem got the first notification, GOJEK was open for business.

At its peak in 2014, GOJEK had 200 drivers. The 3-person engineering team had a basic stop-gap model of matchmaking between a driver and a customer. This codebase had to be reworked to match scale. The new matchmaking codebase was built in two days and could handle about 700 drivers. It was all manual and something had to be done to automate the whole process.

In the beginning of 2015, a version of the app was launched to keep pace with increasing demand. GO-RIDE, GO-FOOD and GO-SEND went live. Customers would ‘bid’ for a driver, drivers would get a notification, accept a drive and voila, we’re good to go. This was the birth of the ‘bid engine’ — a classic matchmaker between supply and demand: Driver and Customer. It would form the genesis on which GOJEK was going to be built. The problem: siloed boxes.

There were a total of three products with the same underlying infrastructure, but no interconnectedness. THAT was a problem that shouldn’t exist when success depends on deeper linkage between all teams. This problem is further pronounced when you realise all three teams were working on the same infrastructure.

Importantly, GOJEK simply wasn’t prepared to handle the kind of adoption and growth the company began to witness as soon as the app was launched.

The algorithm started to crumble. The engineering was pretty straightforward with 10–15 lines of code, and solved problems for a small set of data. As the drivers increased, downtimes became a routine affair. There were way too many bottlenecks. GOJEK was failing, and fast.

Soon, Sequoia had mutual investment portfolios and unlocked some doors. Sidu Ponnappa, our current India Head, then the CEO of CodeMonk, travelled to Indonesia to pick between three of Sequoia’s companies. The team’s ultimate decision to work with GOJEK is not entirely surprising because it was bigger, larger than anything they had witnessed in India. The market was ripe for the taking. Read his telling tale from his first visit to Indonesia here.

In no time, Nadiem acquired CodeMonk. But before that, our current CTO, Niranjan Paranjappe was being poached. 😉 The team stood together. It was all, or none.

And Nadiem wanted all. The deal was closed in a small tea shop between Sidu, Niranjan, Nadiem, Ajey and Kevin. Overnight, GOJEK had one of India’s best consulting firms in its arsenal. The task for the engineering team: Work on the bidding engine. No more downtimes.

It’s the 0’s and 1’s

The old codebase was written in Java. It’s a programming language that belonged to the Internet age. But not for a startup in 2015 that was exploding in demand and imploding with a lack of resources and engineering wherewithal. Why Java? Because, the classic Golden Hammer Anti-Pattern:

“If all you have is a hammer, everything looks like a nail.” And hence, ‘I know Java, so Java is the best.’

Niranjan Paranjape, our now CTO (Ajey Gore is our Group CTO), plugged in the hard drive and checked the code. As soon as he opened the README file, the first line was mvn install -DskipTest

The code had *never* been tested.

In other words, the code was live without ever passing a single quality check. The old codebase was called Stan Marsh. For the uninitiated, Stan Marsh is a character from South Park, and if you watch the show, you’d get the obvious reference to the famous line:

“Dude, this is pretty f****d up right here.”

And thus it came to be. Stan Marsh was the legacy code on which GOJEK was going to be built. Because there was no test harness, it was difficult to understand which portion of the app was working, and which wasn’t. Considering the app was live, no one wanted to touch a ticking time bomb. It was… sorry, is… very much part of engineering folklore. (More on that later)

As urban legends go, Niranjan re-wrote the entire codebase in Golang, a language he didn’t know. Three nights. A dozen Redbulls. Two dozen coffees. Golang could handle concurrency, manage load; the kind GOJEK was witnessing. The mothership was ready. Or so the team thought.

It wasn’t an easy decision to go with Golang. Not many knew the programming language. But some risks are worth taking — and that defines good engineering from great. Luckily, this initial decision-making set the tone for the team; learn, experiment, adapt, take responsibility or be disrupted. In a month, GOJEK’s driver count tripled. But… there were more problems to come. Bigger fish to fry.

For Part 2 of the story, please click here.


Story credits: Shobhit Srivastava, Ranjeet Singh, Mehakdeep Singh, Bergas Bimo Branarto

This is Part 1 of a feature story profiling the Allocations team at GOJEK. Leave a 👏 if you enjoyed reading it. We’re also expanding across South East Asia and hiring engineers to help us. If you want to know more, visit superapp.is. Grab this opportunity to work with the best and brightest minds. 🖖