Databricks Unity Catalog: Volume – Full Explanation


πŸ“¦ Databricks Unity Catalog: Volume – Full Explanation

πŸ”Ή What is a Volume?

A Volume in Databricks Unity Catalog is a secure, governed folder used to store non-tabular data like:

  • CSV, JSON, and Parquet files
  • Images, PDFs, logs
  • Machine learning models or artifacts

It acts like a data lake directory, but with fine-grained access control, audit logging, and native Databricks support.


πŸ”Ή Why Use a Volume?

BenefitDescription
βœ… Secure StorageAccess is controlled via Unity Catalog privileges like READ_VOLUME, WRITE_VOLUME
πŸ” GovernedActivity is audited just like with tables
πŸ”„ ReusableCan be shared across notebooks, workflows, and ML models
πŸ”§ Simplifies AccessNo need to manually mount or manage external paths in code

πŸ”Ή Volume Location

A volume is always created inside a catalog β†’ schema β†’ volume path like:

/Volumes/<catalog>/<schema>/<volume>

πŸ”Ή Volume Types (as seen in UI)

1. πŸ” Managed Volume

  • Stored in Databricks-managed cloud storage.
  • Databricks handles the physical storage location.
  • Deleted automatically when dropped.
  • Use Case: Temporary datasets, quick experiments, staging data.

2. 🌐 External Volume

  • Points to your own cloud storage path (ADLS, S3, GCS).
  • Requires a Storage Credential (IAM role, SAS token, etc.).
  • Storage persists even if volume is dropped.
  • Use Case: Production data lakes, shared cloud buckets.

πŸ”Ή Creating a Volume (via UI or SQL)

πŸ”§ Via UI:

  • Choose name, volume type, optional comment.
  • For external, you also need to choose storage credential and path.

🧾 Via SQL:

-- Managed Volume
CREATE VOLUME catalog.schema.volume_name
COMMENT 'This is a managed volume for training data';

-- External Volume
CREATE EXTERNAL VOLUME catalog.schema.external_volume
LOCATION 'abfss://container@account.dfs.core.windows.net/my-data'
WITH STORAGE CREDENTIAL my_credential
COMMENT 'External volume for shared S3 bucket';

πŸ”Ή Volume Privileges

PrivilegeDescription
USE_VOLUMEReference the volume
READ_VOLUMERead files inside the volume
WRITE_VOLUMEAdd, delete, or update files
OWNFull control (ownership, permissions)
GRANT READ_VOLUME, WRITE_VOLUME
ON VOLUME catalog.schema.volume_name
TO 'user@company.com';

πŸ”Ή Where to Use Volumes

  • In notebooks:
df = spark.read.csv('/Volumes/catalog/schema/volume_name/data.csv')
  • In ML pipelines or Delta Live Tables
  • For storing checkpoints, logs, images, model outputs, etc.

πŸ”Ή Governance & Lineage

  • Volumes are listed in information_schema.volumes
  • Support audit logging via system.access.audit
  • Integrated with Unity Catalog’s permission model

βœ… Summary

FeatureManaged VolumeExternal Volume
Stored inDatabricks-managed storageYour cloud (S3/ADLS/GCS)
Auto-cleanupβœ… Yes❌ No
Needs Storage Credential❌ Noβœ… Yes
Governanceβœ… Yesβœ… Yes
Access via /Volumes/βœ… Yesβœ… Yes

Related Posts

Z-ORDER in Databricks: Magic or Myth?

When it helps, when it hurts, how to pick columns, and what KPIs to measure. Introduction: Why the Hype Around Z-ORDER? If you’ve spent time in Databricks,…

Read More

Taming Small Files in Delta Lake

Optimal file sizes, compaction strategies, and how to keep your Delta tables lightning-fast Why Small Files Are a Big Problem Delta Lake is powerful, but it inherits…

Read More

Databrick Serverless compute plane networking

Here’s a simple line-by-line summary of the Serverless compute plane networking (08/04/2025): General idea Serverless egress control (outbound connections) Network Connectivity Configuration (NCC) What NCC enables: Extra…

Read More

Databrick Serverless compute limitations

Here’s a simple, line-by-line summary of the Serverless compute limitations (09/29/2025): General limitations Streaming limitations Machine learning limitations Notebook limitations Job limitations Compute-specific limitations Caching limitations Hive…

Read More

Best practices for Databrick serverless compute

Best practices for serverless compute Big picture Before you migrate Ingesting data (getting data in) Querying external data (without moving it) Spark configurations Watch your costs Quick…

Read More

Databrick Serverless compute release

Here’s a simple line-by-line summary of the important points from the Serverless Compute release notes (09/24/2025): Perfect πŸ‘ Here’s a one-page cheat sheet table for the Serverless…

Read More
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x