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 store | Online store | |
|---|---|---|
| Holds | every value with its timestamps, for months | the latest value per key |
| Read by | training and batch scoring, as large scans and joins | the serving path, a few keys at a time |
| Latency | minutes per job | single-digit milliseconds per read |
| Typical technology | columnar tables in a warehouse or lake | a 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.