Rebuilding a national logistics network in 14 weeks
- Client
- Meridian Freight Group
- Industry
- Logistics
- Year
- 2024
- Duration
- 14 weeks
- Team
- 6 engineers, 2 designers
- Services
- Platform engineering · Cloud & DevOps · Design systems
Meridian ran 1,900 daily line-haul routes on a dispatch system written in 2009. We replaced it live, a percent of traffic at a time, without pausing a single shipment.
The product
Rebuilt interface, live figures. Everything below is the shipped surface, not a concept.
Active lanes
1,904
Full replan
38s
p95 API
180ms
Corridor load
p95 dispatch API, ms
MEM → DFW · 8 stops
Run 4471
Offline · 3 scans queued
Driver PWA — offline manifest
Dispatch was one Rails monolith: 700 tables, no read replicas, and a routes table nobody would run a migration against without a maintenance window. Planning ran as an overnight batch, so a truck that broke down at 06:00 stayed wrong on every screen until the next morning — the floor covered the gap with a whiteboard and a phone. Peak season pushed p95 API latency to 2.4 seconds. On-call was absorbing sixty pages a month, and roughly half of them were the same deadlock on the same table.
We spent the first two weeks on the dispatch floor in Memphis rather than in the repo, which is where the actual problem showed up: the overnight batch was not just stale, it was distrusted, so the floor kept a second plan on paper. We split the monolith along three seams that already existed in the org chart — dispatch, telematics ingest, billing — and moved each behind a strangler proxy so traffic could shift a percent at a time and roll back in seconds. The new planner recomputes on every telematics event instead of once a night, reading a Kafka log the legacy system also writes to. That is the part that made the cutover boring: both stacks ran on identical input for nine weeks while we diffed their output every morning, until the diffs stopped being interesting.
We cut over in week 14, one region at a time, with no shipment held. p95 landed at 180ms, and a full network replan went from eight hours to 38 seconds — which changed how the floor works more than the latency did, because a replan became something you just try. Empty running fell from 10.3% of kilometres to 6.1% over the following two quarters, and paging is down to around four a month. We still run the platform under a 24/7 agreement. The whiteboard is gone.
Solid lines carry request traffic. Dashed lines are asynchronous — replication, shadow reads and audit trails that must never sit on the critical path.
// Out-of-order pings are common on the corridor radios, so the// sequence guard runs before anything touches the planner.export function onTelematics(event: TelematicsEvent) { const lane = laneFor(event.vehicleId) const pending = queue.get(lane) if (pending && event.seq <= pending.seq) return queue.set(lane, { seq: event.seq, observedAt: event.observedAt }) planner.schedule(lane, { debounceMs: 250, maxDelayMs: 2000 })}A tractor pings every four seconds. Replanning per ping would queue 1,900 recomputes a minute, so lanes coalesce on a short debounce with a hard ceiling.
Region eleven of fourteen, on a Tuesday afternoon, with freight moving.
p95 dispatch API latency, down from 2.4s at peak
Empty running across the line-haul fleet, 10.3% of km down to 6.1%
Dispatch availability measured across peak season, error budget untouched
Figures reported by Meridian Freight Group after launch.
- 01Event-sourced dispatch core with fully replayable route history
- 02Strangler proxy enabling percentage-based cutover from the monolith
- 03Planner that recomputes 1,904 lanes on every telematics event
- 04Driver PWA with offline manifest capture for dead-zone corridors
- 05Shared design system adopted by dispatch, billing and the driver app
- Next.js
- Go
- PostgreSQL
- Kafka
- Terraform
- AWS ECS
- Grafana
“They moved 1,900 routes a day onto a new stack without a single missed delivery. Our drivers noticed because the app got faster, not because anything broke.”