Uber-Style Ride-Hailing Database Model
Ride-hailing platforms need a database that captures customers, drivers, trips, payments, surge pricing, and real-time status while enforcing role-based access for different user types.
Architecture
- Normalized schema: CUSTOMER, DRIVER, DRIVER_STATUS, TRIP, TRIP_STATUS, PAYMENT, VEHICLE, RIDE_TYPE, STATUS, STATUS_MASTER, SURGE_PRICING
- Role-based access: ADMIN (bootstrap), APPLICATION_ADMIN, CUSTOMER, DRIVER, FLEET_MANAGER with grants per role
- Views for filtered access: customer profile/trips, driver trips/earnings, support cases, low-rated trips, drivers without license
- Stored procedures and DML for sample data and reproducible setup
Tech Stack
Scale
Multi-role production-style schema with views and procedures
Challenges
- Designed schema to support trip lifecycle, surge pricing, and driver availability
- Implemented 8+ views for role-based and analytical access without exposing raw tables
- Documented ERD, run order, and grant strategy for clean deployment
Impact
Delivers a reusable database model for ride-hailing with clear separation of concerns and secure, auditable access for each user type.
