Classify Cluster Type & Configuration for Optimal Performance
All-purpose vs. job clusters, autoscaling, spot instances, and driver/worker sizing. Choosing the right compute is the single biggest lever you have over both the cost and the speed of everything that runs on the lakehouse — and the exam tests whether you know which knob to turn.
01Why compute choice is the biggest lever
Every notebook you run, every pipeline you schedule, and every dashboard query executes on compute — a cluster of virtual machines running Apache Spark. Pick the wrong type of cluster and you either burn money on idle machines or throttle a production job. Size it wrong and you spend twice as long — and twice as much — as you needed to.
Compute cost is measured in DBUs (Databricks Units) — a unit of processing consumed per hour, on top of the raw cloud VM cost. Different cluster types are billed at different DBU rates, so the type you choose has a direct, permanent effect on your bill.
Right compute is a design decision, not an afterthought. It sets the ceiling on how fast, cheap, and reliable everything downstream can be.
🎯 Exam focus
For the Associate exam, the two must-know distinctions are: all-purpose vs. job clusters (which to use when, and which is cheaper), and how autoscaling, spot instances, and node sizing trade cost against performance and reliability. Almost every compute question is really asking "which option is the most cost-effective way to meet this requirement?"
02The two cluster types at a glance
Databricks gives you two fundamental kinds of general-purpose Spark compute, and the difference is entirely about who creates them and how long they live:
- All-purpose clusters are created by a person, can be shared by many users, and stay running until stopped. Built for interactive work.
- Job clusters are created automatically by the scheduler when a job starts, and are torn down the instant the job finishes. Built for automated work.
A third compute type, the SQL Warehouse, is dedicated to SQL and BI workloads and comes in Classic, Pro, and Serverless flavours — worth knowing it exists, but the two clusters above are the heart of this subdomain.
💡 The load-bearing analogy
An all-purpose cluster is a hire car you keep for the week — always parked outside, ready whenever you want to drive, and you pay for every hour whether you're driving or not. A job cluster is a taxi — it appears exactly when you need the trip, takes you there, and vanishes the moment you arrive. For a single scheduled errand, the taxi is far cheaper.
03All-purpose clusters — interactive work
All-purpose (interactive) clusters are for exploration and collaboration: writing and testing code in notebooks, ad-hoc analysis, debugging, and shared development. Their defining trait is that they persist — you start one, several engineers attach to it, and it keeps running across many notebook runs until someone stops it or it auto-terminates.
Characteristics
- Created manually via the UI, CLI, or API, and can be restarted.
- Shared by multiple users at once, which is great for collaboration.
- Higher DBU rate — you pay a premium for that always-on interactivity.
- Auto-termination is the key cost control: set an idle timeout so the cluster shuts itself down after N minutes of inactivity instead of running all night.
⚠ Common pitfall
Running production jobs on an all-purpose cluster is the classic cost mistake. You pay the higher interactive DBU rate, and a cluster left running after the work is done quietly bleeds money. Automated work belongs on a job cluster — always.
04Job clusters — automated workloads
Job clusters (also called automated clusters) are created on demand by the Databricks job scheduler. When a scheduled or triggered job runs, a fresh cluster spins up, executes the job, and is automatically terminated when the job completes. You cannot restart a job cluster or attach a notebook to it interactively.
Why they're the right default for production
- Cheaper: job compute is billed at a lower DBU rate than all-purpose compute.
- Isolated: a clean environment every run means no leftover state, libraries, or variables from a previous run to cause surprises.
- Zero idle cost: the cluster exists only for the duration of the job — nothing is left running afterwards.
- Reliable & reproducible: the same cluster spec is provisioned identically each time the job runs.
🎯 Exam focus
The rule to memorise: interactive / exploratory / shared → all-purpose; scheduled / automated / production → job cluster. If a scenario mentions a nightly pipeline, a scheduled ETL job, or cost-optimised automation, the answer is a job cluster.
05Autoscaling — sizing that adapts
Rather than pinning a fixed number of workers, autoscaling lets Databricks add and remove worker nodes automatically within a range you define (a minimum and a maximum). When a stage needs more parallelism, workers are added; when the cluster goes quiet, idle workers are released to save money.
- You set the min and max worker count; Databricks manages everything in between based on load.
- It scales the number of workers only — the driver node stays a fixed size.
- It's ideal for variable or unpredictable workloads where a fixed size would either bottleneck or waste money.
📝 Note — when autoscaling helps less
Autoscaling shines on bursty, variable batch work. It helps less for steady-state Structured Streaming (load is continuous, so there's little to scale down to) and can even hurt workloads that rely on cached data on specific nodes, since removing a node discards its cache. Match the tool to the workload — don't assume autoscaling is always on.
06Spot instances — cheap, but interruptible
Spot instances use a cloud provider's spare capacity at a steep discount — often a fraction of on-demand price. The catch: the provider can reclaim (evict) them at short notice when it needs the capacity back. That makes spot fantastic for cost savings and risky for anything that can't tolerate a node vanishing mid-task.
The golden rule of spot
Put workers on spot, keep the driver on-demand.
If a spot worker is reclaimed, Spark simply re-runs its lost tasks on the remaining nodes — a slowdown, not a failure. But if the driver is lost, the entire cluster dies and the job fails. So the standard, cost-optimised pattern is spot workers (ideally with fallback to on-demand if spot capacity is unavailable) and an on-demand driver.
🎯 Exam trap
Watch for answers that suggest putting the driver on a spot instance to save money. That's a trap — losing the driver terminates the whole cluster. The correct cost-vs-reliability balance is on-demand driver + spot workers.
07Driver & worker sizing
A Spark cluster is one driver node coordinating many worker nodes. Knowing what each does tells you which one to make bigger when performance suffers.
The coordinator
Runs the driver program, maintains cluster state, schedules tasks, hosts the notebook REPL, and collects results back from the workers.
Executor
Runs tasks on a partition of the data in parallel.
Executor
Runs tasks on a partition of the data in parallel.
Executor
Runs tasks on a partition of the data in parallel.
Size the driver up when…
- You pull large results back to the driver —
collect(),toPandas(), or displaying huge outputs. - You broadcast a large table in a join (the driver stages the broadcast).
- You run many concurrent notebooks / streams on one cluster, or heavy single-node (non-Spark) Python.
Scale the workers out when…
- Your data is large and the bottleneck is distributed compute — more workers means more parallelism.
- Jobs are shuffle- or CPU-heavy and would finish faster with more executors.
Choosing an instance family
- Memory-optimised — for shuffle-heavy joins, aggregations, and caching-heavy workloads.
- Compute-optimised — for CPU-bound work with modest memory needs.
- Storage-optimised — for workloads that benefit from fast local disk caching (Delta / disk cache).
📝 Note — the single-node cluster
A single-node cluster has a driver and zero workers — the driver acts as both. It's ideal for small data, lightweight jobs, or single-machine ML libraries that don't distribute across Spark. Don't use it for large, distributed workloads; there's nothing to parallelise onto.
08Configuring for optimal performance
Once you've picked a type, a handful of settings do most of the work of balancing cost against speed:
- Auto-termination on every all-purpose cluster — the simplest way to kill idle spend.
- Autoscaling for variable batch workloads, with a sensible min/max range.
- Spot workers + on-demand driver for cost-tolerant jobs.
- Instance pools — keep a set of ready, idle VMs warm so clusters start in seconds instead of minutes, cutting job latency.
- Photon — Databricks' vectorised query engine that accelerates SQL and DataFrame workloads; it costs extra DBUs but often improves overall price/performance.
- Right-size, don't over-provision — pick node families and counts that match the actual bottleneck (memory vs CPU vs disk).
// A job cluster: autoscaling workers + spot with on-demand driver { "new_cluster": { "spark_version": "15.4.x-scala2.12", "node_type_id": "Standard_DS4_v2", "autoscale": { "min_workers": 2, "max_workers": 8 }, "azure_attributes": { "availability": "SPOT_WITH_FALLBACK_AZURE", // workers on spot "first_on_demand": 1 // driver stays on-demand } } }
09All-purpose vs. job — the table
The exam frequently hands you a scenario and asks which cluster fits. Lock in the distinctions:
| Dimension | All-purpose | Job cluster |
|---|---|---|
| Created by | A user (UI / CLI / API) | The job scheduler, automatically |
| Lifecycle | Persists until stopped | Terminates when the job ends |
| Restartable | Yes | No |
| Shared | Yes — many users | No — dedicated to one job |
| Best for | Interactive, exploratory, collaborative | Scheduled, automated, production |
| DBU cost | Higher | Lower |
| Idle cost risk | High (mitigate with auto-terminate) | None — dies with the job |
10Design decisions & common mistakes
- Production jobs on all-purpose clusters. Higher DBU rate plus idle-cost risk. Use job clusters for anything scheduled.
- Driver on spot. One eviction kills the whole cluster. Keep the driver on-demand; only workers go on spot.
- Scaling out when the driver is the bottleneck. Adding workers won't help a
collect()-heavy or broadcast-heavy job — that needs a bigger driver. - Assuming autoscaling always helps. Steady streaming and cache-dependent jobs may see little benefit or even disruption.
- No auto-termination. The most common source of surprise bills is an interactive cluster left running overnight.
- Over-provisioning "to be safe." Bigger isn't faster if the bottleneck is elsewhere; match node family to the actual constraint.
💡 Architect's rule of thumb
Default to job clusters with autoscaling, spot workers, an on-demand driver, and instance pools for production. Reserve all-purpose clusters for genuine interactive work, and always set an auto-termination timeout. That single default pattern eliminates the majority of real-world Databricks cost problems.
11Exam tips & practice questions
Key facts to memorise
- All-purpose = interactive, shared, manual, persists, restartable, higher DBU cost.
- Job cluster = automated, single job, terminates on completion, not restartable, lower DBU cost.
- Autoscaling adjusts workers between min/max; the driver is fixed.
- Spot = cheap but reclaimable → workers on spot, driver on-demand.
- Driver coordinates + collects results; workers execute tasks in parallel.
- Single-node cluster = driver only, no workers; for small / single-machine work.
- Auto-termination controls idle cost; pools cut start-up time; Photon speeds SQL/DataFrame work.
- A.A shared all-purpose cluster left running 24/7
- B.A job cluster created by the scheduler for each run
- C.A single-node all-purpose cluster
- D.A SQL Warehouse
Reveal answer
Scheduled, automated production work belongs on a job cluster: lower DBU rate, isolated environment, and zero idle cost because it terminates when the job finishes.
- A.They terminate automatically when a job completes
- B.They cannot be restarted once stopped
- C.They can be shared by multiple users for interactive work
- D.They are billed at a lower DBU rate than job clusters
Reveal answer
All-purpose clusters are shared, interactive, and restartable. Options A and B describe job clusters, and D is backwards — all-purpose compute is billed at a higher DBU rate.
- A.Driver and all workers on spot
- B.Driver on spot, workers on-demand
- C.Driver on-demand, workers on spot with fallback
- D.All nodes on-demand only
Reveal answer
Losing the driver terminates the whole cluster, so the driver must stay on-demand. Workers on spot (with fallback to on-demand) capture the savings while a reclaimed worker only causes task re-runs, not a failure.
df.collect() on a very large result and the driver runs out of memory, even though workers are underused. What is the best fix?- A.Add more worker nodes
- B.Increase the max autoscaling limit
- C.Use a larger driver node
- D.Switch the workers to spot instances
Reveal answer
Collecting large results happens on the driver, so the fix is a bigger driver — adding or scaling workers doesn't relieve driver memory pressure. (Better still, avoid collecting large results to the driver at all.)
- A.The size of the driver node
- B.The number of worker nodes, between a min and max
- C.The Spark version
- D.The DBU billing rate
Reveal answer
Autoscaling adds and removes worker nodes within the min/max range you configure. It does not change the driver, the runtime version, or the billing rate.
- A.Job cluster; spot instances
- B.All-purpose cluster; auto-termination timeout
- C.Job cluster; auto-termination timeout
- D.All-purpose cluster; Photon
Reveal answer
Collaborative interactive work needs an all-purpose cluster. Its idle-cost risk is controlled with an auto-termination timeout that shuts the cluster down after a period of inactivity.
- A.A driver with a fixed number of workers that cannot autoscale
- B.A driver with no workers, where the driver runs the workload itself
- C.A cluster restricted to SQL workloads only
- D.A cluster that runs only on spot instances
Reveal answer
A single-node cluster has only a driver and zero workers — the driver acts as both coordinator and executor. It suits small data and single-machine (non-distributed) libraries, not large distributed jobs.
- A.Enabling Photon
- B.Using an instance pool of warm, ready VMs
- C.Lowering the autoscaling minimum to zero
- D.Switching to a higher DBU tier
Reveal answer
Instance pools keep idle VMs warm so a cluster can acquire nodes in seconds rather than waiting for the cloud provider to provision them. Photon speeds query execution, not cluster launch.
- A.Autoscaling will dramatically cut cost because load is constant
- B.Autoscaling provides limited benefit because load doesn't fluctuate much
- C.Autoscaling is required for all streaming jobs
- D.Autoscaling scales the driver up during peaks
Reveal answer
Autoscaling delivers the most value on bursty, variable workloads. A steady-state stream has little idle capacity to scale away, so the benefit is limited. Autoscaling never resizes the driver.
- A.Driver executes tasks in parallel; workers coordinate the job
- B.Driver coordinates and collects results; workers execute tasks in parallel
- C.Both driver and workers only store data, never compute
- D.Workers schedule tasks; the driver holds the data partitions
Reveal answer
The driver coordinates the job, schedules work, maintains state, and collects results; the workers run the actual tasks on data partitions in parallel. The other options reverse or confuse these roles.
12Quick-reference cheat sheet
Interactive · shared · manual · restartable · higher DBU. Set an auto-termination timeout.
Automated · single job · terminates on completion · not restartable · lower DBU. Production default.
Adds/removes workers between min & max. Driver is fixed. Best for variable batch.
Cheap but reclaimable. Workers on spot, driver on-demand — losing the driver kills the cluster.
Bigger driver for collect() / broadcast / many streams. More workers for large distributed compute.
Pools → faster starts · Photon → faster SQL/DataFrame · auto-terminate → less idle cost.
That's Subdomain 3.2 in full. The mental model is simple: match the compute to the workload. Interactive and collaborative work goes on all-purpose clusters with auto-termination; automated production work goes on cheaper, self-terminating job clusters. Then tune with autoscaling, spot workers behind an on-demand driver, pools, and Photon. Get the type right first, size second, and the exam's cluster questions become predictable.
Good luck on the exam!