12/35
Part 2 of 3 · Two stores, one truthLearn

Two stores: all of history for training, the latest value for serving

Training and serving ask the feature layer very different questions.

Training scans history, and serving reads a few keys

Offline storeOnline store
Holdsevery value with its timestamps, for monthsthe latest value per key
Read bytraining and batch scoring, as large scans and joinsthe serving path, a few keys at a time
Latencyminutes per jobsingle-digit milliseconds per read
Typical technologycolumnar tables in a warehouse or lakea key-value store or cache

Every tier writes to two places, because training and serving read in opposite ways.

Uber's 2017 post on Michelangelo, its ML platform, describes the pattern. Uber added a feature store: one place where teams share, find and use a curated set of features. Features for online models are computed ahead of time and stored in Cassandra, where they can be read at low latency at prediction time. The post counted about 10,000 features in the store.

The lookup costs time. Uber typically saw a p95 latency under 5 ms for models that read nothing from Cassandra, and under 10 ms for models that read Cassandra features. p95 is the time 95 of every 100 requests finish within.

Give every offline row two timestamps: when its data ends, and when it went online. Training needs both to rebuild what serving read.