Sub topic 1
The compute landscape in Databricks
Every notebook cell, job task, and pipeline in Databricks runs on compute. This chapter maps the kinds of compute and the questions that separate them. Later chapters cover each kind in detail.
Prerequisites
This chapter assumes you have:
- Used the Databricks workspace and run a notebook.
- Basic Apache Spark knowledge: a driver coordinates work and executors process data in parallel.
- Cloud basics: virtual machines and pay-as-you-go billing.
- Enough JSON to read a configuration file.
What "compute" means
Compute is the set of machines that run your code. In classic Databricks compute, a cluster is a group of cloud virtual machines: one driver and zero or more workers. You choose a Databricks Runtime version, which bundles Spark and supporting libraries. You also choose the machine sizes and the number of workers.
Serverless compute removes those choices. Databricks runs the machines and picks the sizes and runtime for you.
The three kinds of compute
| Kind | Created by | Lifetime | Typical use |
|---|---|---|---|
| All-purpose cluster | A person or a script | Until terminated by you or by idle shutdown | Interactive notebooks and exploration |
| Job cluster | A job run | Starts with the run, ends when it finishes | Scheduled and automated work |
| Serverless compute | Databricks, on demand | Managed by Databricks | Notebooks, jobs, and SQL without cluster management |
All-purpose and job clusters are both classic compute. They differ in lifecycle and in how they are shared.
- All-purpose clusters stay up between commands, so several people can attach notebooks to one cluster and keep their state. The cost is that an idle cluster keeps billing until it shuts down.
- Job clusters are private to one run. Nothing is left running afterward, and the per-DBU rate is lower than for all-purpose compute. You cannot attach a notebook to one and experiment.
- Serverless compute starts in seconds because Databricks keeps capacity ready. You give up control over node types and runtime versions in exchange for less setup.
Three questions that separate them
- Who manages the machines? With classic compute, you configure them, and they run in your cloud account. With serverless, Databricks manages them.
- How long does the compute live? An all-purpose cluster outlives any single task. A job cluster lives for one run.
- Who shares it? An all-purpose cluster can serve a team. A job cluster serves one run.
This path is a simplification. Serverless is not available in every workspace or for every workload, and the final decision also depends on cost and governance. The "Choosing the right compute for a workload" chapter returns to that decision.
How cost fits in
Classic compute has two charges. Databricks bills Databricks Units (DBUs), a measure of processing per hour. Your cloud provider separately bills the virtual machines. Serverless compute is billed through DBUs, and the infrastructure cost is folded into that rate rather than appearing on your cloud bill. The cost chapter works through the arithmetic.
Where this tutorial goes next
The next chapters cover the driver and worker structure, Runtime versions, and access modes. They are followed by a chapter on each kind of compute, then autoscaling, cost, policies, pools, and defining compute as code.
SQL warehouses are another compute type, built for SQL queries and dashboards. This tutorial concentrates on compute for notebooks and pipelines, so they are out of scope.
Exercise
A team runs one notebook every night at 2 a.m. and nobody uses it interactively. They do not want to choose node types. Which kind of compute fits best, and which would be the next choice if serverless is not enabled in their workspace?
Show answer
Serverless compute fits best because the work is automated and they want no cluster configuration. If serverless is not enabled, a job cluster is the next choice. It starts with the run, ends when the run finishes, and has a lower DBU rate than an all-purpose cluster.