Three Ways of Deploying a Model

Three Ways of Deploying a Model

After training and registering a model, we need to make it available for predictions. The right deployment mode depends on the prediction request, its latency requirement, and the amount of data waiting to be scored.

Batch, online, and streaming

Batch deployment scores a complete data partition on a schedule. It's a good fit when results can arrive later, such as daily predictions for all rides.

Online deployment exposes a request/response service. A caller sends one feature record and receives a prediction quickly. A Flask service behind a container is a simple implementation of this approach.

Streaming deployment reacts to events as they arrive. A message broker or event stream accepts records, and a consumer scores them continuously. The course example uses Amazon Kinesis with AWS Lambda.

Deployment modes start with a model artifact

Choose the boundary carefully

All three modes need the same serving API:

  • the model to load.
  • the transformation for an input record.
  • the prediction format to return.

They differ in how they receive data and how long they can wait before producing a result.

A model inside an online web-service boundary

Start with the simplest mode that meets the product requirement. Batch is usually easiest to operate. Online services add request handling and availability concerns. Streaming adds event ordering, retries, duplicates, and cloud-resource costs.

An online request and response flow

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.