IT Vizag
← MLOps: Shipping ML Models

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

MLOps: Shipping ML Models · Lesson 8 of 14 · 2 min read · 4 min video

Batch vs real-time predictions

When to score in bulk overnight and when to answer every request live.

📄 Download slides (PDF)· free sign-up

Not every prediction needs an instant answer. Choosing between batch and real-time serving is one of the biggest decisions in an ML system. It changes your cost, complexity and speed.

Batch predictions

Score everything at once, on a schedule, and save the results:

  • Every night, predict which customers are likely to stop ordering, and send the list to the marketing team
  • Every morning, forecast demand for each store in Vizag

Batch is simple and cheap: one job, no always-on server, and easy retries. The downside is that predictions are only as fresh as the last run.

Real-time predictions

Answer each request as it arrives:

  • Fraud check while a UPI payment is happening
  • A price estimate the moment someone fills in a form
  • Recommendations as a user scrolls

Real-time is fresh, but you need an always-on service, low latency, scaling and much closer monitoring.

How to choose

Ask three questions:

  1. Does the input exist before the user asks? If yes, batch usually works
  2. How stale can the answer be? Hours or days → batch. Seconds → real-time
  3. How many predictions, how often? Millions of rows once a day is a batch job. A few requests a second needs a service

The middle ground

  • Pre-compute and look up: run a batch job, store the results in a fast database, and serve them instantly
  • Streaming: score events from a queue such as Kafka within seconds, without a request–response API
Tip: Start with batch whenever the product allows it. You can move to real-time later, and it's much easier to build and run.

In one line

Use batch when predictions can be computed ahead of time and real-time only when the answer must reflect the latest input, because batch is far simpler and cheaper.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend