System Design of Doordash: Geo-Hashing and WebSockets for Location Based Services
Gaurav Sen Gaurav Sen
592K subscribers
97,891 views
1.7K

 Published On Jul 25, 2022

We go through a popular interview question: Design Doordash.

The system design of Doordash (similar to Swiggy and Zomato in India) involves matching food orders to riders. A rider has to be selected based on their location proximity to the restaurant (since the time taken to deliver a order from restaurant to customer wont change on rider).

For this, we shard geographical locations using hashes, known as Geo-Hashing. An area can be recursively broken down using a geo hash. Riders within a goehash region can be asked to pick an order on demand.

Tracking a delivery is done using server-side events or WebSockets. I suggested the idea of WebRTC for this, but it seems like overkill. Let me know your thoughts :D

Jordan's YouTube Channel: ‪@jordanhasnolife5163‬

Location-based databases:    • Designing a location database: QuadTr...  
System Design Website: https://interviewready.io

00:00 Intro
01:35 Functional Requirements
02:50 Capacity Estimations
06:45 API Endpoints
08:10 Data Sources
11:30 Onboarding a restaurant
12:20 GeoHashes
23:20 Driver Updates
27:00 Data Consistency
28:30 Consistent Hashing
36:40 Optimizing Deliveries
40:20 Delivery Tracking
44:44 WebRTC
46:18 Concluding thoughts

You can follow me at:
Github: https://github.com/coding-parrot/
Instagram:   / applepie404  
LinkedIn:   / gaurav-sen-56b6a941  
Quora: https://www.quora.com/profile/Gaurav-...
Twitter:   / gkcs_  

#SystemDesign #InterviewReady #Coding

show more

Share/Embed