Inferensys

Glossary

Online Feature Serving

The process of providing pre-computed and real-time features to a machine learning model at prediction time with extremely low latency, typically from a feature store.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
REAL-TIME DATA FOR PREDICTION

What is Online Feature Serving?

Online feature serving is the low-latency process of providing pre-computed and real-time features to a machine learning model at the moment of prediction, typically from a specialized feature store.

Online feature serving is the architectural capability that retrieves and transforms raw data into model-ready feature vectors with millisecond latency during a prediction request. Unlike batch training, it must combine historical aggregates from an offline store with real-time data from a stream processor to construct a complete, point-in-time correct snapshot of the entity being scored.

This process is the operational backbone of a feature store, ensuring consistency between training and inference pipelines. It relies on a high-performance key-value cache or vector database to avoid querying slow transactional databases, directly enabling use cases like real-time fraud detection and next-best-action models where stale data renders the prediction worthless.

LOW-LATENCY INFERENCE INFRASTRUCTURE

Key Characteristics of Online Feature Serving

Online feature serving is the critical bridge between feature engineering and model inference, delivering pre-computed and real-time features at prediction time with strict latency guarantees.

01

Ultra-Low Latency Retrieval

Online feature serving must retrieve features in single-digit milliseconds to meet the demands of real-time personalization. This is achieved through in-memory caches, key-value stores like Redis, and direct service-to-service communication that bypasses slow disk I/O. The target is typically p99 latency under 10ms for a full feature vector lookup, ensuring the feature retrieval step does not become the bottleneck in the overall inference pipeline.

< 10ms
Target p99 Latency
10k+
Queries Per Second
03

Feature Vector Assembly

Online serving is not a single lookup; it's a real-time join across disparate data sources. A single prediction request may require:

  • Pre-computed features from a low-latency online store (e.g., user's 30-day average order value)
  • Real-time features computed on the fly from a stream processor (e.g., items viewed in the current session)
  • Contextual features passed directly in the request (e.g., device type, current time) The serving layer assembles these into a single, ordered feature vector matching the model's exact input signature.
04

Feature Transformation Consistency

The logic used to compute a feature online must be byte-for-byte identical to the logic used during training. This requires a shared transformation library or DSL that can execute in both batch (Spark, SQL) and real-time (Flink, Kafka Streams) contexts. Any divergence—such as a different rounding function or null-handling strategy—introduces training-serving skew that silently degrades model performance in production without triggering obvious errors.

05

High Availability and Fault Tolerance

Online feature serving is a critical path dependency for real-time applications. If the feature store is unavailable, the model cannot make predictions. Architectures must include:

  • Multi-zone replication of the online store
  • Circuit breakers that fail open with default feature values
  • Local caching on the inference pod to survive network partitions A common pattern is a two-tier cache: a local in-process cache backed by a distributed Redis cluster, providing both speed and resilience.
99.99%
Target Availability
06

Freshness vs. Consistency Trade-off

Online serving must balance data freshness against consistency guarantees. A feature computed from a streaming pipeline may be milliseconds stale but eventually consistent, while a feature from a transactional database can be strongly consistent but slower. Architectures often use a dual-read pattern: serve from the fast, eventually-consistent cache for most requests, but fall back to the authoritative source for high-stakes decisions where staleness is unacceptable.

ONLINE FEATURE SERVING

Frequently Asked Questions

Clear, technically precise answers to the most common questions about serving machine learning features at prediction time with extremely low latency.

Online feature serving is the process of providing pre-computed and real-time features to a machine learning model at prediction time with extremely low latency, typically from a feature store. It works by decoupling feature computation from model inference. When a prediction request arrives, the serving infrastructure retrieves the latest feature values from a low-latency data store—often an in-memory key-value cache like Redis or a specialized online feature store—and combines them with any real-time features computed on-the-fly from the incoming request payload. This ensures the model receives a consistent, point-in-time correct feature vector without the overhead of recalculating historical aggregations during the critical inference path. The architecture typically involves a feature registry that defines feature metadata, an offline store for batch computation, and an online store optimized for single-digit millisecond reads.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.