Sub topic 5
Managed versus external volumes
This chapter assumes you know what a Unity Catalog catalog and schema are, and that you can run SQL in a notebook. A volume is a Unity Catalog object that holds files. It comes in two types, and the type decides who owns the storage and what happens when you drop the volume.
The two types
A managed volume keeps its files in the managed storage location of its schema. Unity Catalog chooses the cloud path for you. A volume's type is set when you create it and cannot be changed later.
An external volume points at a directory in your own cloud storage. You supply the path, and that path must fall inside an external location you can use. An external location is a Unity Catalog object that pairs a storage path with a credential.
| Property | Managed volume | External volume |
|---|---|---|
| Storage path | Chosen by Unity Catalog | Chosen by you |
| `LOCATION` clause | Not allowed | Required |
| Extra privilege to create | None beyond `CREATE VOLUME` on the schema | `CREATE EXTERNAL VOLUME` on the external location |
| Effect of `DROP VOLUME` | Files are deleted | Files stay in cloud storage |
| Typical use | New files that Databricks owns | Files that other systems also write or read |
Creating each type
A managed volume needs only a name:
CREATE VOLUME IF NOT EXISTS main.default.landing
COMMENT 'Raw files before ingestion';An external volume adds the EXTERNAL keyword and a LOCATION. The bucket below is an example, so replace it with a path covered by your own external location:
CREATE EXTERNAL VOLUME IF NOT EXISTS main.default.partner_drop
LOCATION 's3://my-company-landing/partner/inbound'
COMMENT 'Files delivered by a partner system';You can check the type of any volume with DESCRIBE VOLUME:
DESCRIBE VOLUME main.default.partner_drop;The output includes the volume type and its storage location.
Same paths, different lifecycle
Both types use the same path format, so notebook, Spark and SQL code does not change:
/Volumes/main/default/landing/sales.csv
/Volumes/main/default/partner_drop/2026/orders.jsonThe difference shows up when you drop a volume.
DROP VOLUME main.default.landing; -- managed: the files are deleted too
DROP VOLUME main.default.partner_drop; -- external: only the registration is removedRules for external volumes
- The path must be inside an external location, and you need the
CREATE EXTERNAL VOLUMEprivilege on that location. - The path must not overlap a table or another volume. Unity Catalog rejects overlapping registrations.
- Databricks does not control other writers. If another system changes or deletes the files, your notebooks see the change immediately.
Choosing between them
Start with a managed volume unless you have a reason not to. It needs no external location setup, and Unity Catalog handles cleanup for you. Choose an external volume when files already exist in a bucket, or when an outside pipeline writes into the same directory.
Exercise
A team registers an existing bucket directory as a volume, and later runs DROP VOLUME on it. What happens to the files, and which volume type did they most likely create?
Show answer
The files stay in the bucket, because dropping an external volume removes only its Unity Catalog registration. They most likely created an external volume, since a managed volume would have deleted the files.