Problem
Teams with real-time ML models need feature values at inference time, with low latency. A full feature store with shared definitions for training and serving is a large investment, so a serving path often comes first. Each shortcut has a price. Here Nubank describes three serving-path patterns it runs and what each costs.
Example from the article: a model needs the number of times a customer opened the app in the last 2 hours, or a running count of purchase requests over the last 24 hours.
Solution in brief
Pick the pattern by how fresh the feature must be and how much latency the model can take. Pre-compute nightly into a key-value store when staleness is acceptable. Aggregate on request in a real-time OLAP database (Pinot) when freshness matters. Materialize with a two-stage Flink job into DynamoDB when freshness matters and the read must stay a simple lookup.
Questions this case answers
- How to supply a low-latency model with features of acceptable freshness when training and serving computations live in different systems
- How to choose between materializing features for every entity and computing them on request when only a small share of entities is scored each day
- How to serve fresh features to a real-time model without a full feature store?
- How to decide between pre-computed and on-demand features for online scoring?
Tools and methods
- Nightly snapshot to a key-value store (DynamoDB or Redis) — one denormalized row per entity, served by a single key lookup.
- Apache Pinot with SQL aggregation — on-demand features computed at request time over short-lived events.
- Apache Flink (two apps) with Amazon DynamoDB — streaming materialization of features, read by key.
- Apache Spark over events in Amazon S3 — training datasets built from a spine of entity IDs and as-of timestamps (point-in-time join).
Google or a one-time email code. No password.