#programming #systemDesign Map Navigation High Level Features User inputs destination Give user a few possible routes to destination Ranked from fastest to slowest Takes in account user preference Realtime tracking of user's location Traffic & road condition updates Let's get started User Inputs Location Some variation of Djikstra's or A* algorithm Most routes are pre-computed already Store common routes in cache User Starts Driving/Moving Every 10-15 seconds client makes API call to update user's location data. Steps: Client sends location update to server using HTTP Client updates Map UI as user moves around Data Model Why Cassandra? Extremely high write throughput High volume of data Scale horizontally user_id timestamp location 100 1324543434 (-25, 43) 200 190893438 (50, 125) Primary Key --> (user_id, timestamp) Partition Key --> user_id Clustering Key --> Timestamp (descending order) Very easy to get most recent location of a user Location Data to Optimize System Location data used to optimize everything else in real time Especially, traffic conditions and ETAs Real-time Updates Things can change as user is moving: Accidents on the way Deteriorating road conditions Dynamic ETA