Databricks Shared compute is an access mode that lets multiple users use a single cluster simultaneously. Built on Unity Catalog and process-level isolation, it prevents data leakage between users while drastically cutting cost by reducing cluster count.
That said, Shared mode comes with important constraints that Single User mode does not: no RDDs, no ML runtime, and restricted custom UDFs. This article walks through the isolation mechanism, the full set of constraints, the cost optimization payoff, and a decision flow for choosing between Single User and Shared.
Shared mode is an access mode where multiple users can use the same cluster resources at the same time. Each user attaches to the cluster and runs their own notebook, but under the hood process-level isolation prevents any user from touching another user's data or code.
Shared mode guarantees the following behaviors:
Shared mode security is implemented as a two-layer stack: the Unity Catalog data governance layer plus process-level isolation.
| Isolation Layer | Mechanism | Threat It Prevents |
|---|---|---|
| Data access control | Per-user permission checks via UC GRANT / DENY | Access to tables the user has no rights to |
| Process isolation | Each user's Python process runs independently | Reaching into another user's memory space |
| Temporary object isolation | TEMP VIEW / TEMP TABLE are visible only within the owning session | Stealing another user's intermediate data |
| Secret isolation | dbutils.secrets.get is gated by per-user ACLs | Access to another user's credentials |
In exchange for stronger security, Shared mode restricts the following capabilities. This is a frequently tested topic on the exam and directly drives mode selection in production.
| Constraint Category | Restriction | Reason |
|---|---|---|
| Low-level APIs | RDD / SparkContext / sc.parallelize() are not usable | RDDs can execute arbitrary bytecode and could bypass process isolation |
| ML runtime | Cannot select DBR ML (ML libraries are unavailable) | ML libraries execute native code and could cross the isolation boundary |
| Custom UDFs | Inline Python UDFs / Pandas UDFs registered in-session are restricted | They would run arbitrary Python code on workers (UC-registered UDFs remain available) |
| Init scripts | Cluster-scoped init scripts cannot be used | Init scripts run as a privileged process and can circumvent the isolation mechanism |
| Libraries | Installing arbitrary cluster-level libraries is restricted | Prevents library conflicts in a shared environment and isolation bypass via native extensions |
| Spark configuration | Security-relevant Spark configuration changes are blocked | Prevents users from disabling the isolation mechanism |
Cost efficiency is the headline benefit of Shared mode. With Single User mode, each user occupies their own cluster, so you end up paying for as many clusters as you have team members. With Shared mode, the whole team shares 1-2 clusters and you get the following cost savings.
Which mode to pick in production is driven by your workload requirements. Use the decision flow below.
[Workload needs ML libraries / GPU?]
├─ Yes → Single User (DBR ML)
└─ No
├─ [Need RDD / SparkContext / low-level APIs?]
│ ├─ Yes → Single User
│ └─ No
│ ├─ [Need custom init scripts / arbitrary libraries?]
│ │ ├─ Yes → Single User
│ │ └─ No
│ │ ├─ [Multiple concurrent users?]
│ │ │ ├─ Yes → Shared (best cost efficiency)
│ │ │ └─ No → Single User or Shared (either works)
│ │ └─ END
│ └─ END
└─ END| Criterion | Shared | Single User |
|---|---|---|
| Concurrent users | Multiple users | Single user only |
| ML runtime | Not supported | Supported |
| RDD / SparkContext | Not allowed | Allowed |
| Custom UDFs | Restricted (UC-registered UDFs only) | No restriction |
| Init Scripts | Not allowed | Allowed |
| Cost efficiency | High (shared cluster) | Low (dedicated) |
| Execution identity | Each user's own credentials | Credentials of the attaching user |
| Unity Catalog required | Yes | Yes (when UC is enabled) |
Shared mode comes up often on the Data Engineer Associate and Platform Admin exams. Expect these patterns:
Data Engineer Associate / Platform Admin
問題 1
20 data analysts run ETL using SQL and the PySpark DataFrame API. Each uses their own Single User cluster, and monthly cost is exploding. They do not use ML libraries or RDDs. Which option is the most cost-efficient fix?
正解: B
Because the team uses neither ML libraries nor RDDs, none of the Shared mode constraints apply. Consolidating 20 Single User clusters down to 2-3 Shared clusters dramatically cuts driver node cost and idle time. Spot Instances reduce cost but do not reduce cluster count. SQL Warehouses cannot run PySpark. Shrinking cluster size offers only marginal savings.
What happens if I try to use RDDs or SparkContext in Shared mode?
You get a runtime error. To enforce process isolation, Shared mode blocks direct access to the RDD API and SparkContext. spark.read / spark.sql / the DataFrame API all work, but low-level APIs like sc.parallelize() and rdd.map() are not available. If you need them, switch to Single User mode.
Are Python UDFs completely unusable in Shared mode?
Not entirely. Managed UDFs registered in Unity Catalog (SQL/Python UDFs defined via CREATE FUNCTION) work fine. What is restricted is inline Python UDFs and Pandas UDFs registered in-session via spark.udf.register(). The exam frequently tests this distinction: UC-registered UDFs are allowed.
How big is the cost difference between Shared mode and Single User mode?
The DBU unit price is the same, but operating cost diverges dramatically. If a team of 10 each spins up their own Single User cluster, you pay for 10 clusters. With Shared mode the same team works on 1-2 clusters, and idle time also drops. SQL-heavy teams have reported 60-80% cost reductions after moving to Shared mode.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Databricks Certifications: All 7 Exams, Difficulty & Study Plan (2026)
Complete guide to all 7 Databricks certifications — Data Eng...
Databricks Exam Difficulty Ranking: All 7 Certs Compared (2026)
Every Databricks certification ranked by difficulty, with st...
Databricks Study Guide: Fastest Pass Route & Time Estimates (2026)
How to pass Databricks certifications efficiently. Official ...
Databricks Data Engineer Associate: Complete Guide (2026)
Domain-by-domain breakdown of the Databricks Certified Data ...
Databricks Data Engineer Professional: Complete Guide (2026)
Tactics for the Databricks Certified Data Engineer Professio...