Request flows
1. Search Request Flow
Objective: The user searches for a location or a point of interest (POI).
- Client Interaction:
- User inputs a search query (e.g., "restaurants near me").
- Client sends the query to the API Gateway.
- API Gateway:
- Routes the request to the Search and Autocomplete Service.
- Search and Autocomplete Service:
- Parses the query and fetches matching results from the Search Index Database.
- Filters results based on user preferences (e.g., ratings, distance).
- Search Index Database:
- Provides a ranked list of matching POIs or addresses.
- Response to Client:
- Results are sent back to the client for display.
2. Route Calculation Request Flow
Objective: The user requests the best route between two locations.
- Client Interaction:
- User inputs start and destination points.
- Client sends a request to the API Gateway.
- API Gateway:
- Validates the request and forwards it to the Route Calculation Service.
- Route Calculation Service:
- Queries the Map Data Database for road network information.
- Incorporates live traffic data from the Traffic Data Service.
- Computes the best route using algorithms like Dijkstra or A*.
- Real-Time Traffic Data:
- Fetches live traffic updates from Real-Time Traffic Database to adjust weights (e.g., road congestion).
- Response to Client:
- Returns the best route, alternate routes, and ETAs to the client.
3. Real-Time Navigation Request Flow
Objective: Provide real-time navigation updates during a trip.
- Client Interaction:
- User starts navigation, and the client sends periodic location updates to the API Gateway.
- API Gateway:
- Forwards the updates to the Real-Time Tracking Service.
- Real-Time Tracking Service:
- Updates the user’s position in the Real-Time Location Tracking Database.
- Checks for route deviations or traffic changes.
- Route Calculation Service (if needed):
- Recalculates the route dynamically based on new traffic data or deviations.
- Response to Client:
- Sends real-time updates, including route changes and ETAs, back to the client.
4. Traffic and Incident Updates Flow
Objective: Aggregate and display live traffic conditions and incidents.
- Traffic Sensors/User Devices:
- Send GPS data, speed, and incident reports to the API Gateway.
- API Gateway:
- Routes data to the Traffic Data Service.
- Traffic Data Service:
- Aggregates reports and updates the Real-Time Traffic Database.
- Detects patterns of congestion and verifies user-reported incidents.
- Response to Clients:
- Updates are sent to the Route Calculation Service and clients using the data for live maps.
5. Offline Maps Flow
Objective: Provide offline access to maps and routes.
- Client Interaction:
- User selects a region for offline use and sends a request to the API Gateway.
- API Gateway:
- Routes the request to the Offline Map Service.
- Offline Map Service:
- Fetches map tiles and precomputed route data from Offline Map Storage.
- Compresses and packages the data for download.
- Response to Client:
- Client downloads the offline map package for local storage.
6. Notification Flow
Objective: Notify users about traffic incidents, route changes, or suggestions.
- Trigger Event:
- An event (e.g., accident report, significant traffic delay) occurs, triggering the Notification Service.
- Notification Service:
- Fetches relevant user sessions from the Real-Time Location Tracking Database.
- Generates notifications and queues them in the Notification Queue.
- Delivery:
- Notifications are sent via push services (e.g., Firebase) or SMS.
- Response to Client:
- User receives a notification with actionable information.
7. Analytics and Insights Flow
Objective: Analyze traffic trends, user behavior, and system performance.
- Data Ingestion:
- Real-time and historical data (e.g., traffic patterns, user searches) are ingested into the Data Pipeline.
- Data Processing:
- Processed in the Analytics and Reporting Database.
- Machine Learning:
- Predictive models are trained to forecast ETAs, traffic conditions, and user preferences.
- Insights Delivery:
- Results are visualized in dashboards or used to improve system recommendations.
Summary of Request Flows:
- The API Gateway is the central entry point, routing requests to the appropriate services.
- Each service relies on its associated database or data pipeline to fetch or store information.
- Real-time and offline interactions are supported with caching, distributed processing, and fault-tolerant design.
- Notifications, analytics, and personalisation enhance user experience, keeping the system responsive and scalable.