The history of “calling a cab” began in 17th century London. In most places, cabs are more affordable than ever. They are also becoming a lot more accessible: we can order a taxi by phone, via mobile applications, or on the Web. Or we can use the same techniques that have been working for hundreds of years – line up at a cab station or flag one down on the street.
The taxi business model isn’t stagnant by any means. Newer concepts like Uber and Lyft are gaining popularity and will certainly have an impact on the future of taxi services. Of course, all of this complicates the lives of those who run cab companies. Let’s take a look at the pertinent parts of a data model that a cab company could use to stay organized.
What Do We Want to Achieve with This Cab Database Model?
The model presented in this article will be able to:
- Create driver schedules
- Track driver availability in real time
- Provide drivers with a list of potential rides
- Allow drivers to select a ride from the list
- Calculate drivers’ working hours and earnings
- Store various statistics (e.g. percentage of rides that cancel, payments per driver per month, etc.)
What Do We Need to Know About Taxi Companies?
Before we design a data model for a cab company, we should be able to answer the following questions:
- When do drivers work?
In most cab companies, drivers have predefined schedules. We’ll know the exact times when the driver starts and ends a shift. In some cases, the shift’s start and end times are not defined in advance. For example, members of a cab association can log in and start working whenever they want. They can also log out and end their shift when they choose. Our model should be able to support both options.
- Can a driver work multiple shifts on the same day?
If the driver is a member of a cab association, they may be able to work in the morning, go home, and then work again that same evening. However, in some areas (like New York City) there are legal restrictions on shift length and/or how many hours cab drivers can work each day.
3. Who initiates a ride?
In most cases, a customer will contact the taxi call center and the dispatcher will enter their request into the system. Another scenario occurs when the customer orders a cab directly (by way of mobile app, for instance) and there is no call center employee involved in the process. A third option – which also bypasses the call center – occurs when a customer gets a cab at the station or hails one on the street.