Library / Blogs
Gojek Blog
The blog section provides valuable information on Gojek's engineering ideals, our culture, and insights on where we failed and what we learnt in the process.
By Gojek engineers · Gojek · Added 2026-10-12
All content belongs to Gojek engineers / Gojek. We only link to it and give credit. Report a problem
Learn this article
About 37 min left. Your work is saved as you go.
What you are about to study
Gojek wrote this to explain how they thought about a problem. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Low-Level Design Practice · 11 minCab bookingRiders, drivers and trips: location-based matching, a trip lifecycle and swappable pricing and matching strategies.Read here
The problem
Riders request a trip from A to B. The system finds a nearby available driver, the driver accepts, the trip happens, and the rider pays. Drivers go online and offline and move continuously.
Entities
100%Figure SDA-LLD-08-1 · Cab booking classes · © forcsguy.com
The trip lifecycle
100%Figure SDA-LLD-08-2 · Trip states · © forcsguy.com
Matching
100%Figure SDA-LLD-08-3 · Matching a request · © forcsguy.com
interface MatchingStrategy { choose(req: Request, candidates: Driver[]): Driver | null } const nearest: MatchingStrategy = { choose: (req, ds) => ds.sort((a, b) => dist(a.loc, req.pickup) - dist(b.loc, req.pickup))[0] ?? null, }; class TripService { request(rider: Rider, pickup: Point, dropoff: Point): Trip { const trip = new Trip(rider, pickup, dropoff); // REQUESTED for (const d of this.locations.nearby(pickup, 3_000)) { // candidates if (d.tryClaim(trip.id)) return trip.offerTo(d); // atomic: one trip per driver } return trip.cancel("no drivers"); } }tryClaimis atomic so a driver cannot be offered two trips at once. The location lookup is a spatial index (geohash or quadtree; see the nearby-places lesson).Design notes
- Pricing is a strategy (base, per km, per minute, surge) and the fare is stored on the trip when booked.
- Live location updates are frequent and approximate; keep them in a fast store and do not write every point to the main database.
- Notifications to rider and driver on each state change use the Observer pattern.
- Edge cases: driver goes offline mid-offer, rider cancels after pickup, payment fails (retry, then flag the account).
- Extensions: shared rides, scheduled rides, ratings, and driver incentives.
Real-world reading
Related reading
- Akutan: Distributed Knowledge Graph Store at eBayeBay engineers · eBayCase Studies
- Location Intelligence Resources | Blog & GuidesFoursquare engineers · FoursquareBlogs
- Rate Limiting with NGINXNGINX · F5 / NGINXBlogs
- TAO: Distributed Data Store for the Social Graph at FacebookFacebookPapers
Show 6 moreShow fewer
- TAO: Facebook’s distributed data store for the social graphUwaterlooPapers
- Optimizing CAL Report Hadoop MapReduce Jobs at eBayeBay engineers · eBayCase Studies
- Cloud Bouncer: Distributed Rate Limiting at YahooYahoo engineers · YahooCase Studies
- Concourse: Generating Personalized Content Notifications in Near-Real-Time at LinkedInLinkedIn engineers · LinkedInCase Studies
- Linux Foundation BlogLinux Foundation engineers · Linux FoundationBlogs
- Gojek BlogGojek engineers · GojekBlogs
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Gojek Blog.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Aroma: Using ML for Code Recommendation at Facebook
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains…
FacebookIntermediate
Case Studies · Read here
Brooklin: Distributed Service for Near Real-Time Data Streaming at LinkedIn
Brooklin—a distributed service for streaming data in near real-time and at scale—has been running in production at LinkedIn since 2016, powering thousands of data streams and over 2 trillion messages per day. Today, w...
LinkedInIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…