A real-time ride-hailing platform for customers, drivers and administrators
A new ride-hailing service needed a backend that matches drivers to riders in seconds and stays consistent while many bookings change at once. The platform is built and documented, and is preparing for launch.
Context
The client is launching a ride-hailing service in the United States with three apps: one for customers, one for drivers and one for administrators. The mobile apps are built in Flutter by the client’s own team; KodeLogiK is building the backend and APIs they run on.
The problem
Ride-hailing is a concurrency problem dressed up as an app. Many riders request at once, drivers accept and cancel, locations update every few seconds, and a booking must never be assigned to two drivers or lost between services. The backend had to be correct under that load from the first day, and still be something a small team could operate.
Our approach
- Microservices with clear ownership. Separate .NET services for bookings, matching, driver location, payments and payouts, and administration, each owning its data, deployed as containers on AWS ECS.
- Real time over SignalR. Ride status, driver position and ETA updates are pushed to the apps over SignalR rather than polled, keeping the apps responsive and the API load predictable.
- Matching protected by Redis locks. Driver matching uses Redis distributed locks so that a driver can be offered one ride at a time and a ride is assigned exactly once, even when several matching workers run in parallel.
- Booking and payout logic in PostgreSQL. Fares, ride state transitions and driver payouts are transactional in PostgreSQL, so money and state never disagree.
- API-first for the mobile team. Every endpoint and event is documented, with a sandbox, so the Flutter team could build against the backend before it was finished.
What we built
- A .NET microservices backend on AWS ECS for bookings, matching, locations, payments, payouts and administration.
- Real-time updates to customer, driver and admin apps over SignalR.
- Driver matching with Redis distributed locks.
- Transactional booking and payout logic in PostgreSQL.
- Documented APIs and a sandbox environment for the client’s Flutter team.
Where it stands
The platform is in progress with the client: the backend and APIs are built and documented for the mobile team, and the service is preparing for launch. Three engineers work on it as a dedicated team.
Have a similar problem?
Tell us what you are building. Hiten reads every enquiry and replies within one working day.
