DEV Community

Calvinburns
Calvinburns

Posted on

Building a Real-Time Cab Dispatch System: Architecture, Challenges, and Lessons Learned

Building real-time logistics and dispatch software requires balancing sub-second auto-allocation with rock-solid reliability across high-concurrency mobile clients.

We recently built Cabree, a cloud-native cab dispatch system designed to give independent taxi and private hire operators a fast, modern alternative to legacy platforms.

Here is a breakdown of our core tech stack, architectural choices, and the technical challenges we solved.


Key Tech Stack

  • Backend: Microservices architecture deployed via Docker containers.
  • Database & Spatial Queries: PostgreSQL + PostGIS extension for boundary matching, spatial indexing, and dynamic distance calculations.
  • Real-time Layer: Redis pub/sub and WebSocket channels for sub-second GPS tracking updates and live dispatch status sync.
  • Frontend Apps: Cross-platform mobile clients with native location services to ensure low battery overhead during extended driver shifts.

Core Engineering Challenges

1. Sub-Second Auto-Allocation

Matching an incoming ride request isn't just about picking the nearest driver by radius. We had to calculate optimal driving routes considering live traffic, driver status, and queue prioritization. Using PostGIS spatial indexing paired with cached Redis driver states allowed us to cut allocation processing down to under two seconds.

2. Managing High-Frequency GPS Pings

Driver apps continuously broadcast location updates. Writing every ping directly to primary persistent storage causes massive DB I/O bottlenecks. We routed high-frequency location streams into a lightweight Redis layer, flushing state snapshots to PostgreSQL only when required for analytics or job completion auditing.

3. Seamless State Synchronization

When an operator updates a job dispatch wallboard, drivers, passengers, and dispatchers need to see those status changes instantly without pulling heavy poll requests. Implementing WebSocket event streams kept network overhead minimal while delivering immediate UI state syncs across all endpoints.


Check out the platform live at cabree.co.uk.

What strategies do you use for managing high-throughput geospatial data or real-time event distribution in your projects? Let's discuss in the comments below!

Top comments (0)