Domain 4: Serving and Scaling Models (Part 1 of 2)
This lesson covers 4 exam topics: Batch and Online Inference, Serving Containers, Model Registry and Versioning, A/B Testing and Canary Rollouts. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Batch and Online Inference
Central question: Batch or online inference, and on which service?
Facts
- Online inference: synchronous requests to a model deployed on an endpoint, for real-time needs (get inferences).
- Batch inference: asynchronous jobs from the model resource without deploying an endpoint; input and output in Cloud Storage or BigQuery; registered BigQuery ML models can run batch jobs (batch inference).
- Serving options: Agent Platform endpoints, Model Garden one-click deployment, Cloud Run (serverless containers, scale to zero) and GKE (full control, custom serving stacks).
Exam traps
- Endpoint kept running for a weekly scoring job. Batch inference.
- Batch for fraud checks at checkout. Needs online.
2. Serving Containers
Central question: Prebuilt or custom serving container?
Facts
- Prebuilt containers provide HTTP inference servers for frameworks such as TensorFlow, PyTorch, scikit-learn and XGBoost, organized by framework and version; they're simpler than custom containers (prebuilt containers for inference).
- Custom containers are needed for unsupported frameworks, custom dependencies or custom serving logic; they must meet the container requirements (health and predict routes, port).
- Custom inference routines (CPR) build a custom container with preprocessing and postprocessing code without writing a model server or Dockerfile, and can be tested locally (custom inference routines).
Exam traps
- Custom Dockerfile for a standard XGBoost model. Prebuilt container.
- Writing an HTTP server just to add preprocessing. Use CPR.
3. Model Registry and Versioning
Central question: How do you organize and version models?
Facts
- Model Registry is a central repository to manage the model lifecycle; it supports custom models, AutoML (tabular and image) and BigQuery ML models without export (Model Registry introduction).
- Models have versions; one is the default version; aliases (such as 'default' or 'champion') and labels organize versions; deploy a version to an endpoint from the registry.
- From a version you can evaluate, deploy, run batch inference and view details.
Exam traps
- A new model ID for every retrain. Add a version to the same model.
- Hard-coding version numbers in apps. Use aliases.
4. A/B Testing and Canary Rollouts
Central question: How do you roll out a new model version safely?
Facts
- Deploy multiple models to one endpoint and use a traffic split (percentages) to route requests between versions (endpoint docs).
- Canary: send a small share (for example 5-10%) to the new version, watch metrics, increase gradually, roll back by shifting traffic.
- A/B test: split traffic between versions to compare a business or quality metric with statistical significance.
- Shadow deployment sends copies of traffic to the new model without using its output, to compare safely.
Exam traps
- Replacing the model for 100% of traffic at once. Use a canary.
- Ending an A/B test before enough data. Results aren't significant.
References
- PMLE exam guide — checked Oct 26, 2026
- Batch inference — checked Oct 26, 2026
- Get inferences — checked Oct 26, 2026
- Prebuilt containers for inference — checked Oct 26, 2026
- Custom inference routines — checked Oct 26, 2026
- Model Registry introduction — checked Oct 26, 2026
- Model versioning — checked Oct 26, 2026
- Choose an endpoint type — checked Oct 26, 2026
Check your understanding
Score a BigQuery table nightly?Show answerHide answer
Answer
Batch inference.XGBoost model, minimal effort?Show answerHide answer
Answer
Prebuilt container.Register a BigQuery ML model?Show answerHide answer
Answer
Model Registry, no export.Route 10% to v2?Show answerHide answer
Answer
Endpoint traffic split (canary).Real-time recommendation API?Show answerHide answer
Answer
Online endpoint.