Logistics & Supply Chain
Use streaming SQL to predict ETAs, rebalance inventory across warehouses, and optimize delivery routes as conditions change.
Trusted by 1,000+ Data-Driven Organizations
for Real-time Analytics
The Problem
Batch-updated ETAs and overnight inventory snapshots leave dispatchers reacting to problems that have already escalated. Every minute of delay compounds across your entire supply chain.
With RisingWave
RisingWave processes fleet telemetry and warehouse events as they happen. Write streaming SQL queries that continuously update ETAs, trigger rebalancing, and reroute deliveries in milliseconds.
A last-mile delivery company operates 3,200 vans across 12 metro areas. Each van runs 80-120 stops per day. Customer satisfaction drops 34% when ETAs are off by more than 15 minutes, but static route estimates don't account for real-time traffic, weather, or driver pace.
| van_id | lat | lng | speed_mph | heading | stops_remaining | ts |
|---|---|---|---|---|---|---|
| VAN-1847 | 39.2904 | -76.6122 | 42.3 | 185 | 34 | 2024-03-15T13:30:01.000Z |
| VAN-1847 | 39.2831 | -76.6098 | 8.7 | 190 | 34 | 2024-03-15T13:31:01.000Z |
| VAN-1847 | 39.2789 | -76.6085 | 5.2 | 188 | 34 | 2024-03-15T13:32:01.000Z |
| VAN-0422 | 33.749 | -84.388 | 38.1 | 270 | 22 | 2024-03-15T13:30:01.000Z |
| VAN-0422 | 33.7488 | -84.3955 | 35.6 | 265 | 22 | 2024-03-15T13:31:01.000Z |
| VAN-3110 | 40.758 | -73.9855 | 12.4 | 45 | 48 | 2024-03-15T13:30:01.000Z |
CREATE SOURCE gps_pings WITH (
connector = 'kafka',
topic = 'fleet.gps_pings',
properties.bootstrap.server = 'broker:9092'
) FORMAT PLAIN ENCODE JSON;
CREATE MATERIALIZED VIEW segment_travel_time AS
SELECT
van_id,
window_start,
AVG(speed_mph) AS avg_speed_mph,
h.historical_avg_speed,
CASE
WHEN AVG(speed_mph) < 1 THEN 999
ELSE ROUND(
h.segment_distance_mi / AVG(speed_mph) * 60, 1
)
END AS est_segment_minutes,
ROUND(
h.segment_distance_mi / h.historical_avg_speed * 60, 1
) AS historical_segment_minutes,
ROUND(
(h.segment_distance_mi / AVG(speed_mph) * 60)
- (h.segment_distance_mi / h.historical_avg_speed * 60), 1
) AS delay_vs_historical_min,
MAX(stops_remaining) AS stops_remaining
FROM TUMBLE(gps_pings, ts, INTERVAL '60 SECONDS') g
JOIN route_segments h
ON g.van_id = h.van_id
AND h.segment_seq = (
SELECT MAX(segment_seq) FROM route_segments r
WHERE r.van_id = g.van_id
AND r.segment_start_lat BETWEEN g.lat - 0.005 AND g.lat + 0.005
)
GROUP BY van_id, window_start, h.historical_avg_speed, h.segment_distance_mi;| van_id | next_stop | original_eta | updated_eta | delay_min | confidence |
|---|---|---|---|---|---|
| VAN-1847 | 35 | 2024-03-15T13:45:00.000Z | 2024-03-15T14:03:00.000Z | 18 | 0.55 |
| VAN-1847 | 42 | 2024-03-15T14:30:00.000Z | 2024-03-15T14:52:00.000Z | 22.1 | 0.55 |
| VAN-0422 | 23 | 2024-03-15T13:50:00.000Z | 2024-03-15T13:52:00.000Z | 1.8 | 0.92 |
| VAN-3110 | 48 | 2024-03-15T13:55:00.000Z | 2024-03-15T14:01:00.000Z | 5.4 | 0.78 |
Use the power of streaming SQL to transform your supply chain operations and deliver a higher standard of service.