Sub topic 2
Choosing between serverless, pro, and classic warehouses
This chapter covers the three SQL warehouse types, what each one supports, and how to pick one. It assumes you know what a SQL warehouse is (the previous chapter), can read basic cost terms such as DBU (Databricks Unit, the billing unit for compute), and have a general idea of cloud networking and accounts.
What the type controls
A SQL warehouse type decides three things:
- Where the compute runs. It runs either in your own cloud account or in Databricks' account.
- Which engine features are available.
- How fast the warehouse starts and how it reacts to load.
The type does not change your SQL, your Unity Catalog names, or the editor. A query that runs on one type runs on the others, unless it depends on a feature the type lacks.
The two places compute can run are called compute planes:
- Classic compute plane. The virtual machines run in your cloud account, inside your network. You pay Databricks for DBUs and your cloud provider separately for the VMs.
- Serverless compute plane. The machines run in the Databricks account. You pay one DBU-based price that already includes the infrastructure.
The three types compared
| Aspect | Serverless | Pro | Classic |
|---|---|---|---|
| Compute runs in | Databricks account (serverless plane) | Your cloud account | Your cloud account |
| Typical start time | Seconds | Several minutes | Several minutes |
| Photon (vectorized query engine) | Yes | Yes | Yes |
| Predictive IO | Yes | Yes | No |
| Intelligent Workload Management | Yes | No | No |
| Cloud VM cost | Included in DBU price | Billed by your cloud provider | Billed by your cloud provider |
| Materialized views, streaming tables, query federation | Yes | Yes | No |
Feature lists change between releases. Check the current Databricks documentation for your cloud before you rely on a row of this table.
Serverless
Serverless is the default choice for most new work. Its main advantages:
- Fast start. A stopped warehouse is ready in seconds, so an aggressive auto stop setting costs you little responsiveness.
- Intelligent Workload Management. The warehouse predicts how expensive each incoming query is and adds capacity before queries queue up. Autoscaling reacts faster than on the other types.
- No VM management. You do not size, quota, or pay for cloud instances yourself.
Its costs and limits:
- The DBU rate is higher than for the other types. The comparison is only fair once you add the VM bill to the other types.
- It requires Unity Catalog and a region where serverless is offered.
- Compute runs outside your network. To reach private data sources, you configure a network connectivity configuration (NCC) in the account console. Some organizations with strict network-isolation rules cannot accept this.
Pro
Pro runs in your cloud account and has most of the engine features. It lacks Intelligent Workload Management and the fast start. Choose it when:
- Serverless is unavailable in your region.
- Policy requires compute to stay inside your own network or account.
- You need pro features such as materialized views or federation but cannot use serverless.
Classic
Classic is the most limited type. It has Photon but no Predictive IO and none of the newer features. It makes sense mainly for simple, predictable workloads in an existing setup where the lower DBU rate matters and no pro-only feature is needed. For new work there is rarely a reason to start with it.
A decision flow
The questions below follow the order in which constraints usually rule options out.
Start time and why it matters
Start time affects cost and user experience together. Take a warehouse that serves a few analysts during office hours.
- On serverless, you can set auto stop to 5 or 10 minutes. The first query after a pause waits a few seconds.
- On pro or classic, the first query after a stop waits minutes. To avoid that, teams often raise the auto stop timeout. A longer timeout means paying for idle time.
So the real comparison is not DBU rate against DBU rate. It is the DBU rate plus the VM cost plus idle time you keep to avoid slow starts. For bursty, interactive workloads serverless is often cheaper in total despite the higher rate. For a warehouse that runs flat out all day, the lower rates on pro or classic can win. Measure with your own usage, using the monitoring tools covered later in this tutorial.
Creating each type
In the UI, open SQL Warehouses, choose Create SQL warehouse, and select the type. Through the REST API, the type is two fields: warehouse_type (PRO or CLASSIC) and enable_serverless_compute. A serverless warehouse is PRO with serverless enabled.
curl -X POST "$DATABRICKS_HOST/api/2.0/sql/warehouses" \
-H "Authorization: Bearer $DATABRICKS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "analytics-serverless",
"cluster_size": "Small",
"min_num_clusters": 1,
"max_num_clusters": 2,
"auto_stop_mins": 5,
"warehouse_type": "PRO",
"enable_serverless_compute": true
}'The response contains the warehouse id. To create a pro warehouse, set enable_serverless_compute to false. For classic, set warehouse_type to CLASSIC and enable_serverless_compute to false.
You can also change the type of an existing warehouse in its settings, and the warehouse restarts. Queries running at that moment are interrupted, so make the change outside busy hours.
Common errors and gotchas
- Serverless option missing or disabled. The workspace may not be enabled for serverless SQL, may not be on Unity Catalog, or may be in an unsupported region. An account admin must accept the serverless terms and enable the feature.
- A feature fails on a classic warehouse. If a statement such as creating a materialized view errors out on a classic warehouse, the cause is the type. The SQL is fine. Switch to pro or serverless.
- Serverless cannot reach private data. Outbound connections from the serverless plane do not travel through your own network. Reaching a private database or storage firewall needs NCC setup. A timeout from a query that works on pro often points to this.
- Comparing prices by DBU rate alone. Add the VM and idle costs for pro and classic before concluding that serverless is more expensive.
- Treating the type as permanent. You can recreate or switch a warehouse. Pick a reasonable default, watch cost and query latency for a few weeks, and adjust.
Summary of the decision criteria
- Default to serverless when your region, Unity Catalog setup, and network policy allow it.
- Fall back to pro when compute must stay in your account or serverless is unavailable, and you still need the newer features.
- Use classic only for simple workloads without pro features, where you have confirmed the lower rate pays off.
- Verify the choice with measured cost and latency, not the price list.
Exercise
A team's SQL warehouse is used by 20 analysts in short bursts through the workday, with long idle gaps. Compute must be able to reach a private database inside the company's network, and an admin has told you serverless needs an NCC to do that. The team also wants to create materialized views. Which type do you try first, and what would make you choose pro instead?
Show answer
Try serverless first. It starts in seconds, so a short auto stop timeout keeps idle cost low despite the bursty usage, and it supports materialized views. Setting up an NCC solves the private database access. Choose pro instead if serverless is unavailable in the region, if the NCC setup is not permitted by network policy, or if policy requires compute to run in the company's own cloud account. Classic is ruled out because it does not support materialized views.