![]() |
A Cab Booking System is a service provider that allows users to book a ride from their computer or phone. Users can select the kind of cab they want, enter their pickup and destination, and request a ride. The system will then find a nearby available driver and send the driver to pick up the user. Users can also see the estimated fare and track the cab in real time. A Cab Booking System allows customers to simply schedule trips, check estimated arrival times, and receive ride notifications. ![]() Important Topics for Cab Booking System – Low-Level Design Requirements Gathering for the Cab Booking SystemFunctional Requirements for the Cab Booking System:
Non-Functional Requirements for the Cab Booking System:
Memory and Estimations for the Cab Booking SystemLet’s start with the estimation and constraints because these things help us to make better design decisions that’s why we do estimations along with the requirement gathering. Assumptions for the Cab Booking System:
Low-Level Design for Cab Booking SystemUber and other taxi services are familiar worldwide. Through the application, a user can request a ride, and a driver will come to their location to take them to their destination in a matter of minutes.
![]() 1. ChallengesThe main task of a cab booking service is to match riders with cabs, requiring two distinct services in the architecture:
The dispatch system matches supply with demand. This system uses mobile phones to match drivers with riders (supply to demand). 2. Supply ServiceCabs (supply) are tracked by geolocation (latitude and longitude). Active cabs send their location to the server every 4 seconds via a web application firewall and load balancer. The accurate GPS location is sent to the data center through Kafka’s Rest APIs. Apache Kafka acts as the data hub, updating the latest location in the system. Additionally, details like the number of seats, car seat availability, vehicle type, and occupancy are tracked. 3. Demand ServiceThe demand service receives cab requests via a web socket, tracking the GPS location of the user and their requirements (e.g., number of seats, type of car). It then requests cabs from the supply service. 4. Matching Riders to DriversSharding keys are used by the dispatch system in small cells with unique IDs. Location is shifted by the cell ID whenever a request comes through the supply service from demand service. These cells are managed by servers situated in different regions filtering nearby cabs that the rider’s requirements fulfill. Rather than the geographical distance, ETA is based on the road distance, and a list of available cabs sent back to the supply system for driver assignment. 5. Map RegionsPrior to entering any new region, you must first add it into the map technology stack. These are the type of regions:
6. Map BuildingThe maps used by cab companies are constructed with the help of an external mapping service. At first, this was done using Mapbox; however, it was changed to the Google Maps API in order to make it more precise when tracking a location or calculating the estimated time of arrival (ETA).
7. ETA CalculationETA calculation is critical as it impacts ride-matching and earnings. Factors like traffic and road construction are considered, identifying not only free cabs but also those about to finish a ride. The road network is represented as a graph, with nodes as intersections and edges as road segments. Dijkstra’s algorithm or AI-simulated algorithms determine the best route, considering additional factors like one-way streets, turn costs, and speed limits. OSRM (Open Source Routing Machine) ensures faster performance. This low-level design ensures efficient matching of riders to drivers, scalable dispatch operations, and accurate ETAs for a seamless cab booking experience. Database Design for the Cab Booking System1. Tables:
2. API Design of the System2.1. Display Info for Each User: Stores user information (user_id, name, email, phone, etc.)
2.2. Get Rides for the User: Stores driver information (driver_id, name, email, phone, cab details, etc.)
2.3. Book a Ride: Stores ride details (ride_id, user_id, driver_id, pickup_location, dropoff_location, fare, status, etc.)
2.4. Cancel a Ride: checks the payment status and then cancel the raid.
2.5. Rate a Ride: Stores ride ratings and reviews (rating_id, ride_id, user_id, driver_id, rating, review, etc.)
Database Model for the Cab Booking SystemA database model for a cab booking system is crucial as it helps in managing all the different parts of the system well. Below are descriptions of each table with regards to the cab booking system: ![]()
Microservices used for the Cab Booking SystemMicroservices used in Cab Booking System are:-
ConclusionIn conclusion, you need to think about many different parts and characteristics that are vital for making a Cab Booking System easy to use. For example, it should be able to grow as more people start using , It means that the system needs to be scalable. In addition, such systems must also be safe and secure so that they will not cause any harm or danger the person using them while operating. Besides handling large amounts of requests at once very quickly, this type of program has other features like saving information about users (such as where they live) securely alongside processing their payments effectively. |
Reffered: https://www.geeksforgeeks.org
System Design |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |