---
title: When would you serve predictions in batch vs online? What hybrid patterns exist?
url: https://gurkanozkan.ai/learn/questions/mle-batch-vs-real-time-inference-43/
markdown: https://gurkanozkan.ai/learn/questions/mle-batch-vs-real-time-inference-43.md
kind: question
role: ML engineering
stage: Technical
difficulty: Easy
json: https://gurkanozkan.ai/api/learn/questions/mle-batch-vs-real-time-inference-43.json
robots: noindex
---

# When would you serve predictions in batch vs online? What hybrid patterns exist?

ML engineering · Technical · Easy

## Answer

*Model answer, written in a candidate's voice*

### In short

- Batch when entities are known in advance and staleness is acceptable; cheap and simple to run, e.g. daily scores and email targeting.
- Online for fresh context and latency SLAs, e.g. payments and search, with more ops burden.
- Hybrid: precompute embeddings or candidates in batch, re-rank online, cache results.
- Publish batch predictions as events consumed by other systems, keeping downstream services decoupled from the model pipeline.

### In full

I’d use batch when the entities to score are known in advance, the decision can tolerate staleness, and the output is consumed downstream rather than in the request path—daily scores, email targeting, or similar — because it is cheap and simple to run. I’d use online when fresh context matters and there is a latency SLA, such as payments or search, accepting the extra serving, monitoring and failure-handling burden. In practice I like hybrids: precompute embeddings, candidate sets or features in batch, then re-rank or score online with a tight timeout, and cache results where the same input repeats. A useful pattern is to publish batch predictions as events that other systems consume, so downstream services stay decoupled from the model pipeline. The choice is less about the model than about freshness, latency, cost and who consumes the output.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Batch: cheap, simple, can be stale; suits daily scores and email targeting.
- Online: fresh context, latency SLAs, more ops burden; needed for payments and search.
- Hybrid: precompute embeddings or candidates in batch, re-rank online; cache results.
- Batch predictions can be published as events that other systems consume.

## Common mistakes

- choosing real-time by default
- ignoring feature freshness requirements.

## Topic guides

- [LLM serving: latency, throughput and operations](https://gurkanozkan.ai/learn/topics/serving.md)
- [ML and LLM system design](https://gurkanozkan.ai/learn/topics/system-design.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
