Sensor events arrive continuously and need predictions written within seconds. How is streaming inference typically done on Databricks?
- Exam domain
- Model Deployment and Monitoring13% of the exam
- Difficulty
- Medium
- In this mock
- 6 questions on this domainPractise this domain
Why the exam asks this
Model Deployment and Monitoring (13% of the exam)
Objective in the exam guide: Identify how streaming inference is performed with Lakeflow pipelines
Streaming inference with Lakeflow pipelines is named.
Why C is the answer
Apply the model as a Spark UDF in a Lakeflow pipeline
Loading the model with mlflow.pyfunc.spark_udf and applying it in a streaming pipeline scores events as they arrive.
Remember: Score streams in Lakeflow pipelines.
How it works
Models can be applied inside streaming pipelines as UDFs.
In detail
- spark_udf in a streaming pipeline.
- Scores as data arrives.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. One REST call per event from a laptop scriptWrongMost tempting
Per-event calls from a script do not scale.
Why it tempts: Per-event REST calls seem real time.
B. Manually exporting events to CSV each hourWrong
Hourly exports miss seconds-level needs.
C. Apply the model as a Spark UDF in a Lakeflow pipelineRight
Score streams in Lakeflow pipelines.
D. A nightly batch job that rescans all eventsWrong
Nightly misses the latency.
Use case
An illustrative scenario, not a real incident.
Illustrative: a pipeline scores turbine sensor readings for failure risk within seconds.
See it in different ways
flowchart LR S0["Ingest stream"] --> S1["Load model as spark_udf"] --> S2["Score in pipeline"] --> S3["Write to table"]
How to read this chart
- Read it in order: Ingest stream, then Load model as spark_udf, then Score in pipeline, then Write to table.
flowchart TD
Q{"How fast are predictions needed?"}
Q -->|"Hours, large volumes"| A0["Batch"]
Q -->|"Seconds, continuous data"| A1["Streaming"]
Q -->|"Milliseconds, per request"| A2["Real-time endpoint"]How to read this chart
- At "How fast are predictions needed?": if "Hours, large volumes", go to "Batch"; if "Seconds, continuous data", go to "Streaming"; if "Milliseconds, per request", go to "Real-time endpoint".