All case studies
Logistics2023

Real-Time Fleet Tracking for 50K Vehicles

Re-platforming a polling-based tracker into a streaming pipeline that ingests 200K location events per second with sub-second dashboards.

200K
Events / sec
<800 ms
Dashboard latency
+38%
On-time loadings
−92%
DB write load
Challenge

The dispatch team polled vehicle GPS every 30 seconds, hammering a relational store with writes it could not absorb. Customers complained about stale ETAs; the warehouse missed loading windows; and adding new geofences took weeks of database work.

Architecture

Vehicles publish MQTT telemetry to a regional broker. A stream processor enriches each event with route metadata, applies geofence rules, and emits derived events (arrival, departure, idle, off-route). Hot state lives in Redis for the dispatch UI; cold data sinks to ClickHouse for analytics and SLA reporting.

system.diagram
┌──────────┐    ┌──────────┐    ┌───────────────┐    ┌──────────┐
│ Vehicles │───▶│  MQTT    │───▶│  Stream Proc  │───▶│  Redis   │
└──────────┘    │  Broker  │    │  (geofence +  │    │ (live)   │
                └──────────┘    │   enrichment) │    └────┬─────┘
                                └──────┬────────┘         │
                                       ▼                  ▼
                                ┌────────────┐    ┌──────────────┐
                                │ ClickHouse │    │ Dispatch UI  │
                                │ (history)  │    │  (websocket) │
                                └────────────┘    └──────────────┘
Implementation
  1. 01

    Replaced 30s polling with MQTT QoS 1; battery cost on devices dropped measurably.

  2. 02

    Geofences defined declaratively; rule changes ship in minutes, not weeks.

  3. 03

    Backpressure tested with synthetic 5x peak load to validate broker headroom.

  4. 04

    Exactly-once arrival/departure detection via windowed dedup keyed on (vehicle, geofence).

Results
200K
Events / sec
<800 ms
Dashboard latency
+38%
On-time loadings
−92%
DB write load
Stack
GoMQTTKafkaRedisClickHouseReactAWS
Have a similar problem?

Let's talk about your architecture.

Get in touch