DataBricks Prep · Associate Exam Series
Section 03 · Topic 2 of 6
← Back to all topics
Section 03LiveData Processing & Transformations

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.

Exam guideSubdomain 3.2
DifficultyCore
Read time~16 min

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:

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

⚠ 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

🎯 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.

📝 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.

Anatomy of a Spark cluster
◆ Driver node
The coordinator

Runs the driver program, maintains cluster state, schedules tasks, hosts the notebook REPL, and collects results back from the workers.

│  ╱ │ ╲  │
● Worker 1
Executor

Runs tasks on a partition of the data in parallel.

● Worker 2
Executor

Runs tasks on a partition of the data in parallel.

● Worker N
Executor

Runs tasks on a partition of the data in parallel.

Autoscaling adds / removes workers between min and max · the driver stays fixed

Size the driver up when…

Scale the workers out when…

Choosing an instance family

📝 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:

  1. Auto-termination on every all-purpose cluster — the simplest way to kill idle spend.
  2. Autoscaling for variable batch workloads, with a sensible min/max range.
  3. Spot workers + on-demand driver for cost-tolerant jobs.
  4. Instance pools — keep a set of ready, idle VMs warm so clusters start in seconds instead of minutes, cutting job latency.
  5. Photon — Databricks' vectorised query engine that accelerates SQL and DataFrame workloads; it costs extra DBUs but often improves overall price/performance.
  6. Right-size, don't over-provision — pick node families and counts that match the actual bottleneck (memory vs CPU vs disk).
JSON · Jobs APICost-optimised job cluster spec
// 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:

DimensionAll-purposeJob cluster
Created byA user (UI / CLI / API)The job scheduler, automatically
LifecyclePersists until stoppedTerminates when the job ends
RestartableYesNo
SharedYes — many usersNo — dedicated to one job
Best forInteractive, exploratory, collaborativeScheduled, automated, production
DBU costHigherLower
Idle cost riskHigh (mitigate with auto-terminate)None — dies with the job

10Design decisions & common mistakes

💡 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


Practice question 1
A team runs a production ETL pipeline every night on a schedule and wants to minimise cost. Which compute should they use?
  • 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
✅ Answer: B — Job cluster

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.

Practice question 2
Which statement about all-purpose clusters is TRUE?
  • 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
✅ Answer: C

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.

Practice question 3
To reduce cost, an engineer wants to use spot instances. Which configuration best balances savings and reliability?
  • 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
✅ Answer: C

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.

Practice question 4
A job runs 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
✅ Answer: C

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.)

Practice question 5
When autoscaling is enabled on a cluster, what does Databricks actually scale?
  • 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
✅ Answer: B

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.

Practice question 6
An analyst wants an interactive environment to explore data collaboratively with teammates in notebooks throughout the day. Which cluster type fits, and what setting controls idle cost?
  • 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
✅ Answer: B

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.

Practice question 7
Which describes a single-node cluster?
  • 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
✅ Answer: B

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.

Practice question 8
Which action most directly reduces the cluster start-up time for frequently run 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
✅ Answer: B

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.

Practice question 9
A workload is a continuous, steady-load Structured Streaming job. Which statement is most accurate about autoscaling here?
  • 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
✅ Answer: B

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.

Practice question 10
Which pairing correctly matches each node type to its primary responsibility?
  • 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
✅ Answer: B

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

Cluster Type & Configuration Subdomain 3.2
All-purpose

Interactive · shared · manual · restartable · higher DBU. Set an auto-termination timeout.

Job cluster

Automated · single job · terminates on completion · not restartable · lower DBU. Production default.

Autoscaling

Adds/removes workers between min & max. Driver is fixed. Best for variable batch.

Spot instances

Cheap but reclaimable. Workers on spot, driver on-demand — losing the driver kills the cluster.

Driver vs worker

Bigger driver for collect() / broadcast / many streams. More workers for large distributed compute.

Speed levers

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!