Design a Feature Store for Delivery-Time Predictions
System Design · Medium · 40 min
Design the feature platform behind delivery-time estimates at Parcelpine, a grocery delivery company.
Parcelpine delivers about 1.2 million orders a day from 3,000 partner stores. Its model predicts each order's delivery time at checkout and re-predicts it every 30 seconds while the order is in progress, about 800 predictions per second at peak. Features include how busy the store has been in the last 30 minutes, the number of items, the courier's location and current traffic.
The model's error was 4.1 minutes on offline validation but is 7.8 minutes in production. The team suspects the features the model sees in production differ from the ones it was trained on.
Design a feature system that serves fresh features to the model within 20 ms, produces training data that matches exactly what the model would have seen at prediction time, and lets the team find and prevent mismatches like this one. Cover the storage layers, how features are defined and computed once for both training and serving, backfills, and monitoring.
Clarify requirements first, then design end to end.
