Requirements
Functional
- There would be 2 entities(User & driver) which will use this system
User Requirements:
Driver's Requirements:
2. [Update] Location of driver is updated on real time.
3. [READ] Driver gets notification of near users asking for booking.
4. [Delete] Driver can cancel ride after booking.
BOE
Drivers update their location every 5 seconds.
QPS (Queries Per Second) |
User Queries: 1M / 86400 = 12 queries per second Driver does not do queries, but updates are pushed to driver when driver is not on trip. |
Bandwidth Estimates |
1 User Requests for cab location size = 90 bytes. 12 x 90 = 1080 bytes/sec TCP, IP, DL Header sizes
|
Storage Estimates | Not Huge. We need to store user's & drivers rides |
APIs (CRUD)
User APIs
-
REST API?
REST API Versioning(v1,v2)
1. User Creates a booking |
2. User gets all nearby cabs |
4. User can cancel the ride |
---|---|---|
|
|
|
|
|
|
HLD
-
We will extend quadtree design of yelp here
- Frequent Updates on quadtree:
No. We will create a local datastructure(Hash Table), which will store info of drivers and will send the information after 10-15 seconds. This will reduce frequent updates on system.
Hash Table:
key=driver_id(3 bytes), value={lat(8bytes), long(8bytes)} //19 bytes
500k driver. 10Mbytes of storage