Databricks

Shared Compute Design Guide: Multi-User Access and Security

2026-03-26
更新: 2026-03-27
NicheeLab Editorial Team

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 Access Mode Overview

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:

  • Each user's code runs in an isolated process
  • Unity Catalog permission checks are evaluated against each user's own credentials
  • Users cannot access another user's temporary tables or views
  • Cluster-level resources (CPU / memory) are scheduled fairly across users

Isolation Mechanism Built on Unity Catalog

Shared mode security is implemented as a two-layer stack: the Unity Catalog data governance layer plus process-level isolation.

Isolation LayerMechanismThreat It Prevents
Data access controlPer-user permission checks via UC GRANT / DENYAccess to tables the user has no rights to
Process isolationEach user's Python process runs independentlyReaching into another user's memory space
Temporary object isolationTEMP VIEW / TEMP TABLE are visible only within the owning sessionStealing another user's intermediate data
Secret isolationdbutils.secrets.get is gated by per-user ACLsAccess to another user's credentials

Full List of Shared Mode Constraints

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 CategoryRestrictionReason
Low-level APIsRDD / SparkContext / sc.parallelize() are not usableRDDs can execute arbitrary bytecode and could bypass process isolation
ML runtimeCannot select DBR ML (ML libraries are unavailable)ML libraries execute native code and could cross the isolation boundary
Custom UDFsInline Python UDFs / Pandas UDFs registered in-session are restrictedThey would run arbitrary Python code on workers (UC-registered UDFs remain available)
Init scriptsCluster-scoped init scripts cannot be usedInit scripts run as a privileged process and can circumvent the isolation mechanism
LibrariesInstalling arbitrary cluster-level libraries is restrictedPrevents library conflicts in a shared environment and isolation bypass via native extensions
Spark configurationSecurity-relevant Spark configuration changes are blockedPrevents users from disabling the isolation mechanism

Cost Optimization Benefits

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.

  • Fewer clusters: a team of 10 collapses from 10 clusters down to 1-2. Driver node cost alone drops significantly
  • Less idle time: with Single User mode, a cluster keeps running even when its owner steps away. In Shared mode other users keep the resources busy, so waste shrinks
  • More efficient auto-scaling: by aggregating multiple users' load, worker utilization rises and scale-down decisions become more efficient
  • Shared instance pools: one pool serves every user, so pre-reserved instances stay busier

Single User vs Shared Decision Flow

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

Shared vs Single User Comparison

CriterionSharedSingle User
Concurrent usersMultiple usersSingle user only
ML runtimeNot supportedSupported
RDD / SparkContextNot allowedAllowed
Custom UDFsRestricted (UC-registered UDFs only)No restriction
Init ScriptsNot allowedAllowed
Cost efficiencyHigh (shared cluster)Low (dedicated)
Execution identityEach user's own credentialsCredentials of the attaching user
Unity Catalog requiredYesYes (when UC is enabled)

What the Exam Tests

Shared mode comes up often on the Data Engineer Associate and Platform Admin exams. Expect these patterns:

  • "Multiple users want to share a cluster to control cost" → Shared
  • "Tried to use RDDs in Shared mode and got an error. Why?" → RDDs are blocked to preserve process isolation
  • "Can I run ML workloads on a Shared cluster?" → No (DBR ML is not supported)
  • "How do I use UDFs in Shared mode?" → Only UC-registered UDFs are allowed
  • "What guarantees Shared mode security?" → UC permissions plus process isolation

Check with a Sample Question

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?

  1. Move every cluster to Spot Instances
  2. Stand up 2-3 Shared mode clusters and attach all users to them
  3. Migrate all ETL workloads to a SQL Warehouse
  4. Shrink each user's cluster size and set autotermination_minutes to 5

正解: 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.

Frequently Asked Questions

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.

Check what you learned with practice questions

Practice with certification-focused question sets

無料で問題を解いてみる
Author

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.


Related articles
Databricks

Databricks Certifications: All 7 Exams, Difficulty & Study Plan (2026)

Complete guide to all 7 Databricks certifications — Data Eng...

Databricks

Databricks Exam Difficulty Ranking: All 7 Certs Compared (2026)

Every Databricks certification ranked by difficulty, with st...

Databricks

Databricks Study Guide: Fastest Pass Route & Time Estimates (2026)

How to pass Databricks certifications efficiently. Official ...

Databricks

Databricks Data Engineer Associate: Complete Guide (2026)

Domain-by-domain breakdown of the Databricks Certified Data ...

Databricks

Databricks Data Engineer Professional: Complete Guide (2026)

Tactics for the Databricks Certified Data Engineer Professio...

Browse all Databricks articles (110)
© 2026 NicheeLab All rights reserved.