⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’
Excalidraw Data
Text Elements
LB
booking service
user1 user2 user 3
location service
notification service
websocket connection manager
driver1 driver2 driver3
location tracking db for hostory and analytics
find near by driver
driver accepted ride request
user db booking data
long polling request to find driver
websocket connection estiblased to track user and cab location
kafka queue
booking confirm cancel notification
cab is in user proximity notification
web socket connection db
supply
demand
LB Authenticator rate limiter gateway
users client web app
Ride service
handle fare estimates
search for destination
applies the company’s pricing model to generate a fare estimate on the distance and travel time calculated by Mapping service
Mapping service
Fare details metadata
1
2
3
5
6
return fare details with vehicle type
calculate the distance and travel time between the pickup and destination locations
4
creates a new Fare entity in the Database with the details about the estimated fare.
Requirement 1: user should be able to search vehicles based on destination and get price estimates
fare estimate table schema id source destination eta price userid
response contains different fare details
LB Authenticator rate limiter gateway
users client web app
Ride service
save ride details w.r.t to fare user has selected make ride status as requested
request vehicle
store fare and ride details
1
2
id source destination eta price userid
Ride details
id fareId riderId source destination status: requested
fare estimate table schema
create new ride entity
3
trigger driver matching flow
Requirement2: user should be able to request ride based on the fare he selected
LB Authenticator rate limiter gateway
users client web app
Ride service
save ride details w.r.t to fare user has selected make ride status as requested
request vehicle
store fare and ride details
1
2
id source destination eta price userid
fare estimate table schema
create new ride entity
3
Requirement 3: near by Driver should be matched with the requested ride
driver client web app
Ride matching service
location service
time series db to keep driver locations
redis
store all driver last locations
update drivers last location
InfluxDB
driverId name location vehicle
find nearby driver based on user location and drivers last locations
4
5
1
notification service
get near by drivers using GEOREDIUS
send notification to driver to accept or reject the ride
driver2
accept/reject
8
send to next driver in the matching list
accept ride request receive user cordinates in response from ride service
reject
9’
update ride status to accepted
kafka
send location update every 5 sec
Redis for distributed lock
check if driverId is not locked, before sending notification to driver for new ride
2
3
3’
6
7
9
match queue
Send matching request