Time Series ForecastingStatistical Models (ARIMA, Exponential Smoothing)Medium⏱️ ~3 min

Production Architecture for Statistical Models

Key Point
Statistical models are embarrassingly parallel—each series fits independently. Millions of series can be forecast by distributing work across machines.

BATCH TRAINING PIPELINE

Flow: ingest data daily → fit one model per series → store parameters and forecasts. Fitting one model: 10-100ms. For 1M series on 100 workers: ~20 minutes total. Bottleneck is data I/O, not model fitting.

MODEL STORAGE

Store parameters, not raw data. ETS needs ~50 bytes/series. For 10M series, storage is ~500MB. Pre-compute forecasts for next N periods; store in key-value store for sub-millisecond serving.

💡 Insight: Pre-computed forecasts turn prediction into a lookup. At serving time, just fetch from cache—no inference needed. Latency: <1ms.

FRESHNESS VS COST

Pre-computed forecasts get stale as new data arrives. Daily retraining is typical. Hourly costs 24x more. Some retrain only when drift detected (accuracy drops below threshold).

AUTO MODEL SELECTION

Not all series need the same model. Per-series selection: fit ETS, ARIMA, baseline. Pick winner by cross-validation error. Unpredictable series fall back to baseline when complex models do not help.

⚠️ Trade-off: Auto-selection adds 3x compute but improves accuracy 5-15% on average. Worth it for high-value forecasts; skip for low-stakes.
💡 Key Takeaways
Statistical models are embarrassingly parallel—each series fits independently
Fitting takes 10-100ms per series; 1M series on 100 workers = 15-30 minutes
Store parameters (~50 bytes/series), not raw data; pre-compute forecasts for <1ms serving
Daily retraining balances freshness and cost; hourly costs 24x more
Auto-selection (ETS vs ARIMA vs baseline) improves accuracy 5-15%
📌 Interview Tips
1Explain that pre-computed forecasts turn inference into a cache lookup
2Discuss freshness vs cost tradeoff: daily retraining is typical, hourly is expensive
← Back to Statistical Models (ARIMA, Exponential Smoothing) Overview
Production Architecture for Statistical Models | Statistical Models (ARIMA, Exponential Smoothing) - System Overflow