Managed and External Tables in Delta Lake

Every Delta table in Databricks is either managed, meaning the platform owns both the metadata and the files, or external, meaning the metastore only records metadata while the files live at a storage path you control. The distinction decides what happens on DROP TABLE, who can write to the files, which optimisations Databricks applies automatically, and how easily other engines can read the data. The sections below show where each kind of table lives under Unity Catalog, how to create and convert them, and how to choose.

1. Managed Table

2. External Table

3. Summary

Managed Table: Delta Lake controls both the data and metadata, and automatically cleans up data when the table is dropped.

External Table: Delta Lake only controls the metadata, and the user manages the data location. Dropping the table doesn't remove the data itself.

4. Where the files live

Unity Catalog: managed vs external storage Unity Catalog metastore catalog.schema.table metadata Managed table path chosen by UC External table LOCATION you supply Managed storage location metastore / catalog / schema root External location storage credential + path

In Unity Catalog, a managed table's files are written under a managed storage location configured at the metastore, catalog or schema level, in a directory whose name is generated by Unity Catalog. Users are not expected to access those paths directly; all reads and writes go through the table name, so permissions are enforced by Unity Catalog grants. An external table is created with an explicit LOCATION that must fall inside a registered external location, which pairs a cloud path with a storage credential (an IAM role, managed identity or service account). In the legacy Hive metastore the same split exists, with managed tables placed under the database's warehouse directory.

5. Lifecycle: what DROP does

DROP TABLE behaviour DROP managed metadata removed Files deleted UC: after retention window DROP external metadata removed Files kept still at LOCATION

Dropping a managed table removes the table from the catalog and deletes its data. In Unity Catalog the underlying files are cleaned up after a retention period, and a recently dropped managed table can be recovered with UNDROP TABLE within that window. Dropping an external table removes only the metadata; the Delta files and their _delta_log stay where they were and can be re-registered with another CREATE TABLE ... LOCATION. This is the main safety argument for external tables over shared or regulated data, and the main hygiene argument for managed tables, which do not leave orphaned files behind.

6. Worked example: DDL

-- managed table: no LOCATION
CREATE TABLE main.sales.orders (
    order_id   BIGINT,
    customer   STRING,
    amount     DECIMAL(10,2),
    order_date DATE
);

-- external table: LOCATION inside a registered external location
CREATE TABLE main.sales.orders_ext (
    order_id   BIGINT,
    customer   STRING,
    amount     DECIMAL(10,2),
    order_date DATE
)
LOCATION 's3://acme-lake/sales/orders';

-- which kind is it?
DESCRIBE EXTENDED main.sales.orders_ext;      -- Type: EXTERNAL, Location: s3://...

-- register existing Delta files as an external table
CREATE TABLE main.sales.legacy USING DELTA LOCATION 's3://acme-lake/legacy/orders';

-- copy an external table into a managed one
CREATE TABLE main.sales.orders_managed AS SELECT * FROM main.sales.orders_ext;
# PySpark equivalents
df.write.saveAsTable("main.sales.orders")                              # managed
df.write.option("path", "s3://acme-lake/sales/orders").saveAsTable("main.sales.orders_ext")  # external

Databricks has also added an in-place conversion (ALTER TABLE ... SET MANAGED) for moving Unity Catalog external tables to managed; check availability in your workspace before relying on it, otherwise use CTAS or DEEP CLONE.

7. When to use which

ConcernManagedExternal
Who owns the filesDatabricks / Unity CatalogYou (bucket, path, lifecycle rules)
DROP TABLEDeletes data (recoverable for a period in UC)Keeps data
Automatic optimisationEligible for predictive optimisation and automatic liquid clustering featuresRun OPTIMIZE / VACUUM yourself
Access from other enginesThrough Unity Catalog APIs and credential vendingDirectly from the path, if the engine reads Delta
Typical useDefault for new tables built in DatabricksData produced or consumed outside Databricks, migrations, shared landing zones

Databricks recommends managed tables as the default for anything created inside the platform. External tables remain the right tool when files must stay at a specific path for other systems, when data predates the workspace, or when organisational policy requires that dropping a catalog object never deletes data.

8. Pitfalls