Sub topic 17
Serverless Compute and When It Replaces Manual Sizing
This chapter assumes you know the driver and worker model, how autoscaling bounds work, and the cost model of DBUs plus cloud infrastructure from earlier chapters. It covers the one option where you stop choosing sizes at all.
What serverless changes
On classic compute, you pick the node type, the worker range, the spot settings, and the idle timeout. Your cloud account runs the virtual machines, and you pay for DBUs plus the infrastructure bill.
On serverless compute, Databricks runs the machines in its own account. You don't choose a node type or worker count. Databricks allocates resources for each workload and scales them as the query runs. Startup takes seconds instead of the minutes a classic cluster needs, so you don't need an instance pool to hide startup time. Billing is a single DBU-based charge, with no separate cloud VM line item.
What you stop managing
The following table compares which tuning decisions remain with you.
| Decision | Classic compute | Serverless compute |
|---|---|---|
| Node type and instance family | You choose | Databricks chooses |
| Minimum and maximum workers | You choose | Databricks manages |
| Spot versus on-demand | You choose | Not exposed |
| Idle shutdown | You set auto-termination | Handled by the platform |
| Instance pools | Optional | Not needed |
| Query design, partitioning, and data layout | You own | You still own |
The last row matters most. Serverless removes infrastructure choices, not query design. A skewed join or a badly partitioned table is still slow and still costs DBUs.
What you give up
- Control. You can't pin a specific instance family, such as a memory-optimized node for a large cache.
- Custom setup. Some Spark settings, init scripts, and custom libraries available on classic clusters are restricted or unavailable. Check the current serverless limitations in the Databricks documentation before migrating a job.
- Cost predictability for steady workloads. A job that runs around the clock on a well-tuned, spot-backed cluster can cost less than the serverless DBU rate. Serverless pays off most when load is bursty and idle time is large.
Decision criteria
Use serverless when you want to avoid sizing work, when startup latency matters, or when the load is spiky. Stay on classic compute when you need hardware control, rely on unsupported features, or run steady workloads where spot pricing and tuning give a lower bill.
You can also mix them. Run interactive notebooks and SQL on serverless, and keep a tuned classic cluster for a long-running nightly job.
Checking your own workload
Before you migrate, compare real numbers instead of guessing. Take the monthly DBU and cloud cost of the classic cluster, then run the same job on serverless for a week and compare the total. Use the measure-and-adjust loop from the previous chapter, with cost per run as the metric.
Exercise
A nightly ETL job runs for 6 hours on a tuned autoscaling cluster with spot workers. A separate analyst group runs short ad hoc queries at unpredictable times, with hours of idle time between them. Which workload is the stronger candidate for serverless, and why?
Show answer
The analyst queries. Their load is bursty with long idle gaps, so fast startup and platform-managed scaling remove sizing work and idle cost. The nightly ETL is steady and already tuned with spot pricing, so classic compute may cost less. Measure both before you decide.