Storing · Chapter 06
Delta tables on Databricks: storage, liquid clustering, features
Reviewed by TechFabric engineers. How we write this guide →
A Databricks table is a set of Parquet files in cloud object storage plus a metadata layer that turns them into a transactional table: a Delta Lake transaction log by default, or Apache Iceberg metadata if you ask for it. Unity Catalog registers it as either a managed table, where Databricks owns the storage location, layout and cleanup, or an external table, where you own the path. Managed Delta with liquid clustering and predictive optimization is the default Databricks recommends and the one we'd set.
Most performance problems, and a surprising share of correctness problems, come from this layer, so we'd want every engineer on a Databricks team to understand it rather than treat it as an implementation detail. This chapter is the defaults we'd set, the habits we'd break, and the runtime floors that turn a table feature into an outage. Versions and statuses are as of October 2026.
The short version
Your data sits as ordinary files in your own cloud storage, the cheapest place to keep it, with a small log alongside recording every change. That log makes a pile of files behave like a database table: changes happen completely or not at all, readers never see a half-finished update, and you can ask what the table looked like last Tuesday. Commercially it matters twice over. The files stay yours, in open formats other tools can read. And the platform maintains their layout automatically from how people actually query them, which removes tuning work that used to occupy a specialist.
Managed tables unless you have a reason #
Databricks distinguishes managed tables, where Unity Catalog owns the storage location and lifecycle, from external tables, where you point at a location you manage yourself. Managed is the default and the recommendation for both Delta and Iceberg: a CREATE TABLE without a USING clause makes a managed Delta table, and USING iceberg makes a managed Iceberg one.
What you get on a managed table that you don't on an external one:
| Behaviour | Managed table | External table |
|---|---|---|
After DROP TABLE |
UNDROP TABLE works for 7 days by default, then Databricks deletes the files |
Files stay; you delete them yourself |
| Predictive optimization | On by default for accounts created from 11 November 2024, rolled out to older accounts through August 2026 | Not available |
| Automatic liquid clustering | Available (CLUSTER BY AUTO) |
Not available |
| Multi-statement transactions | GA since 14 October 2026, with catalog commits enabled | Not available |
| Writes from external Spark clients | GA since 13 October 2026, with catalog commits enabled | Through the storage path, ungoverned |
The worry about control deserves a direct answer. Managed storage still lives in a cloud storage account you own, in your subscription, under your keys if you configured them. The platform owns the layout and the lifecycle, not the bytes or the bill.
Catalog commits, and why newer features ask for them #
Several features that went GA in October 2026 require catalog commits, which move commit coordination from the table's own log on storage into Unity Catalog. They've been GA since 8 May 2026 and are off by default. Creating or writing such a table needs Runtime 16.4 or above, and turning the feature on for an existing table needs 18.0 or above:
-- new table
CREATE TABLE sales_prd.silver.orders (order_id BIGINT, amount DECIMAL(18,2), order_ts TIMESTAMP)
TBLPROPERTIES ('delta.feature.catalogManaged' = 'supported');
-- existing managed table (Runtime 18.0+); can take minutes on a write-heavy table
ALTER TABLE sales_prd.silver.events SET TBLPROPERTIES ('delta.feature.catalogManaged' = 'supported');We'd enable it where a table needs multi-statement transactions, external writers or cross-engine policy enforcement, and leave it alone elsewhere for now. The upgrade on an existing table is the risky moment: the docs warn that interrupting it can leave the table locked, so run it in a quiet window and never cancel it.
Delta, and the log that makes it work #
A Delta table is a directory of Parquet files plus a transaction log. Every write appends a commit describing which files were added and removed, which is what gives you atomicity, time travel, and concurrent readers who never see a partial write. The log is checkpointed periodically, so a reader doesn't replay thousands of commits to learn the current state.
Two consequences follow. A table's history is real storage you pay for, governed by its retention properties, so a heavily updated table costs more than its current contents suggest. Worked through once: a 200GB table where a nightly MERGE rewrites files holding 5% of its rows produces about 10GB of superseded files a day. With delta.deletedFileRetentionDuration at 30 days, VACUUM can only remove files older than that, so the table carries roughly 300GB of history beside its 200GB of current data, two and a half times what a SELECT COUNT(*) would lead anyone to expect. Deletion vectors shrink the daily figure, because an update marks rows instead of rewriting whole files. And many small commits produce many small files, the most common cause of a query that got slower for no apparent reason.
Delta or Iceberg: which table format should you use? #
Databricks reads and writes both, and the choice is now mostly about who else reads the table. As of October 2026:
| Option | What it is | Runtime | Use it when |
|---|---|---|---|
| Managed Delta | The default CREATE TABLE |
Any supported | Databricks is the main reader and writer |
| Managed Iceberg | CREATE TABLE ... USING iceberg, maintained by predictive optimization |
16.4 LTS and above | Outside engines write to the table through the Iceberg REST catalog |
| Delta with Iceberg reads | Delta table that also publishes Iceberg metadata (formerly UniForm) | 14.3 LTS and above | Outside engines only read, and you want Delta features on the Databricks side |
| Foreign Iceberg | A table owned by Glue, a Hive metastore or Snowflake Horizon, read through federation | 16.4 LTS and above (requirements) | You're reading someone else's Iceberg estate, read-only |
Iceberg reads on a Delta table are three table properties:
ALTER TABLE sales_prd.gold.daily_margin SET TBLPROPERTIES (
'delta.columnMapping.mode' = 'name',
'delta.enableIcebergCompatV2' = 'true',
'delta.universalFormat.enabledFormats' = 'iceberg'
);The catch depends on the Iceberg compatibility version. With delta.enableIcebergCompatV2, as above, a table can't have deletion vectors, and turning Iceberg reads on for a table that has them means REORG TABLE ... APPLY (UPGRADE UNIFORM(ICEBERG_COMPAT_VERSION=2)) to purge them first. On Runtime 18 LTS and above, delta.enableIcebergCompatV3 publishes Iceberg v3 metadata and keeps deletion vectors (delta.enableDeletionVectors = true), so the trade-off goes away for any table whose outside readers support Iceberg v3. Where they only read v2, we'd publish Iceberg metadata on read-mostly gold tables and keep it off update-heavy silver tables, where deletion vectors earn their keep. Managed Iceberg v3 tables have deletion vectors by default, which is the route if a table genuinely needs both.
Outside engines reach Unity Catalog tables through the Iceberg REST catalog at /api/2.1/unity-catalog/iceberg-rest, after a metastore admin enables external data access and grants EXTERNAL USE SCHEMA. Row filters and column masks used to stop at that boundary. Since 1 October 2026, cross-engine ABAC is GA: an external Spark engine reading a managed table with catalog commits gets the filtered, masked result, computed on Databricks serverless compute that you pay for (it shows in system.billing.usage under billing_origin_product = 'EXTERNAL_COMPATIBILITY'). It's read-only, and dynamic views aren't covered, so a security review per consumer is still worth doing.
Stop partitioning by habit #
Partitioning made sense as a default when the alternative was a full scan of undifferentiated files. On a Databricks table with liquid clustering and predictive optimization available, it's usually a pessimisation. The heuristic we'd use is that a table under roughly a terabyte should not be partitioned at all, and a table above that should use liquid clustering on the columns that appear in filters rather than a Hive-style partition scheme. Date partitioning is the pattern that most often needs undoing, because it produces thousands of directories holding a few megabytes each.
The arithmetic is worth doing once on your own numbers. Take a 600GB events table holding three years of data. Partitioned by day, that's about 1,100 partitions averaging roughly 550MB, which is tolerable. Partitioned by hour it's about 26,000 partitions averaging roughly 23MB, and each hour is itself written as several files by a streaming job, so a query over one month opens tens of thousands of small files before it reads a useful byte. Clustered on event_date instead, the same table compacts toward files of hundreds of megabytes and the month's query skips by file statistics. The data didn't change between those three layouts; only the number of file opens did, and that's the cost a team then tries to fix with a bigger cluster.
How does liquid clustering work, and which runtime does it need? #
Unlike partitioning, liquid clustering keys can be changed later without rewriting the table, and unlike ZORDER, the layout is maintained incrementally as data arrives. The runtime floors are where teams get caught:
| Capability | Requirement |
|---|---|
| Liquid clustering on Delta | Runtime 15.4 LTS and above (GA) |
CLUSTER BY AUTO (keys chosen from query history) |
Unity Catalog managed Delta, Runtime 15.4 LTS and above, predictive optimization on |
OPTIMIZE ... FULL (recluster existing data) |
Runtime 16.4 LTS and above |
| Convert a partitioned table in place | Runtime 18.1 and above |
OPTIMIZE ... FULL WHERE (recluster part of a table) |
Runtime 18.1 and above |
| Liquid clustering on managed Iceberg | Public Preview, Runtime 16.4 LTS and above; AUTO needs Iceberg v3 and 18.0 |
-- a new table, keys chosen by Databricks from the query history
CREATE TABLE sales_prd.silver.orders (order_id BIGINT, customer_id BIGINT, order_ts TIMESTAMP, amount DECIMAL(18,2))
CLUSTER BY AUTO;
-- an existing date-partitioned table, converted in place (Runtime 18.1+)
ALTER TABLE sales_prd.silver.events REPLACE PARTITIONED BY WITH CLUSTER BY (event_date, customer_id);
-- new keys apply to new writes; recluster what is already there (Runtime 16.4 LTS+)
OPTIMIZE sales_prd.silver.events FULL;The in-place conversion doesn't apply to managed Iceberg tables, Lakeflow pipeline streaming tables or materialized views. On a 15.4 or 17.3 LTS cluster it fails, and the older route (create a clustered table and copy into it) is the one available. The copy has costs the in-place statement doesn't, so we'd build it like this:
-- before Runtime 18.1: create the replacement EMPTY, protect it, then fill it with writers paused
CREATE TABLE sales_prd.silver.events_clustered
CLUSTER BY (event_date, customer_id)
AS SELECT * FROM sales_prd.silver.events WHERE false; -- same columns, no rows yet
ALTER TABLE sales_prd.silver.events_clustered SET ROW FILTER sales_prd.security.tenant_filter ON (tenant_id);
ALTER TABLE sales_prd.silver.events_clustered ALTER COLUMN email SET MASK sales_prd.security.mask_email;
-- reapply the tags any ABAC policy matches on, and the grants, here
-- change window: stop every job and stream that writes events, and let them drain
INSERT INTO sales_prd.silver.events_clustered SELECT * FROM sales_prd.silver.events;
-- compare counts and a checksum per partition before going on
ALTER TABLE sales_prd.silver.events RENAME TO sales_prd.silver.events_partitioned;
ALTER TABLE sales_prd.silver.events_clustered RENAME TO sales_prd.silver.events;
-- restart the writers against sales_prd.silver.eventsThe order is the point. A populated table is readable the moment it exists by anyone holding SELECT on its schema or catalog, because Unity Catalog privileges inherit downward, so a copy made by an identity that could see every row and protected afterwards is exposed in between. Creating it empty, binding the row filter and column masks, and only then loading it closes that window. Protection from an ABAC policy on the schema or catalog applies as soon as the table carries the tags the policy matches, so reapply those tags before the INSERT too. Writers stay stopped from the copy to the swap: anything committed after the INSERT would land in the old table and vanish from the read path once the names change. Deep and shallow clones aren't an alternative, since Databricks doesn't support either on a table with row filters or column masks.
The new table starts with an empty history, so time travel to anything before the swap goes through the old table until you drop it. A streaming query reading the old table keeps reading it under its new name, so every downstream stream needs a restart with a fresh checkpoint in the same window. That list is why we'd wait for 18.1 on a table with many readers, and convert by copy only where the readers are few and known.
Two gotchas for the team's notes. Changing the keys doesn't recluster data already written, so a table can look unchanged until OPTIMIZE ... FULL runs, and on a large table that run can take hours and is a cost you schedule. And CREATE OR REPLACE on a table with automatic clustering, written without CLUSTER BY AUTO, switches automatic clustering off and drops the chosen keys, which is easy to do from a notebook that rebuilds a table and very hard to notice afterwards.
Optimization you should not be doing by hand #
Predictive optimization runs OPTIMIZE (including incremental liquid clustering), VACUUM and ANALYZE on Unity Catalog managed tables, Delta and Iceberg, based on observed usage rather than a schedule somebody guessed at. It doesn't touch external tables, and it doesn't run ZORDER. Check it's on at the catalog level and delete the nightly OPTIMIZE jobs it replaces:
ALTER CATALOG sales_prd ENABLE PREDICTIVE OPTIMIZATION;
-- what it did, and what it cost, over the last week
SELECT table_name, operation_type, operation_status, usage_quantity, usage_unit, start_time
FROM system.storage.predictive_optimization_operations_history
WHERE catalog_name = 'sales_prd' AND start_time >= current_date() - INTERVAL 7 DAYS
ORDER BY start_time DESC;It needs the Premium plan or above, and SQL warehouses or Runtime 12.2 LTS and above. Where you still intervene by hand is a table with an unusual write pattern, such as one rewritten wholesale each night, where you know something the optimizer can't infer.
Small files, and the settings that stop them #
Small files are what a table gets from frequent small appends, a stream with a short trigger, or a writer that splits its output into hundreds of pieces. The reader pays for them: a query has to open each file it can't skip, so the same rows spread over thousands of small files take more opens than over a few hundred large ones, which is why Databricks treats file size as a tuning concern of its own (file size tuning). Delta has two settings that deal with this as the data arrives. Optimized writes size files as they're written, and auto compaction merges small files after a write succeeds.
Both are always on for MERGE, UPDATE and DELETE, where they can't be turned off, and Databricks tunes them automatically for Unity Catalog managed tables on SQL warehouses and on Runtime 11.3 LTS and above, unless someone has pinned a target file size (file size tuning). So in review we'd look for two things: a table property or Spark setting that switches them off, and a repartition(n) or coalesce(n) in front of a write. Databricks' guidance with optimized writes on is to avoid coalesce(n) or repartition(n) right before the write, because the writer already sizes the files (file size tuning).
We'd remove the overrides so Databricks tunes the table again, and let the writer size its own files:
-- a managed table: drop the overrides, including a pinned target size, so Databricks tunes it again
ALTER TABLE sales_prd.silver.events
UNSET TBLPROPERTIES IF EXISTS ('delta.autoOptimize.autoCompact', 'delta.autoOptimize.optimizeWrite', 'delta.targetFileSize');
-- a table outside that tuning: compaction on the writing cluster after each write ('auto' is the recommended value)
ALTER TABLE sales_prd.silver.partner_feed
SET TBLPROPERTIES ('delta.autoOptimize.autoCompact' = 'auto', 'delta.autoOptimize.optimizeWrite' = 'true');catalog = dbutils.widgets.get("catalog")
events = spark.read.format("json").load(f"/Volumes/{catalog}/bronze/landing/events/")
# no repartition before the write: optimized writes choose the file sizes
events.write.mode("append").saveAsTable(f"{catalog}.silver.events")Compaction keeps files a sensible size; it doesn't decide which rows sit together. That is the layout's job, and liquid clustering with predictive optimisation (above, and in Stop partitioning by habit) is what replaces a nightly OPTIMIZE ... ZORDER BY.
Where it doesn't apply: an export where the consumer wants one file, such as a small CSV dropped in a volume for a partner, where coalesce(1) is the point, and a table predictive optimisation doesn't cover, such as an external table well over a terabyte, where Databricks still recommends running OPTIMIZE on a schedule.
Schema evolution, and being deliberate about it #
Delta will add columns when you ask it to, which is convenient until an upstream system renames a field and you silently acquire a second column holding half the data. We'd allow automatic schema evolution in bronze, where the contract is deliberately loose, and forbid it in silver and gold, where the schema is a published contract and a change goes through a pull request like any other interface change.
Put a view between the table and its readers #
The physical table is where federation becomes Delta, partitioning becomes clustering, and a table gets rebuilt with a new layout. A view in front of it keeps the column names and grain the consumers depend on, so each of those changes happens underneath without anyone re-pointing a dashboard. Andrey Taran's embedded-analytics project changed its table layer several times behind two Unity Catalog views without touching the dashboards; the full account is in Real-time and CDC and his write-up.
Two habits follow. Judge a layout against production-sized data, because at a hundred thousand rows no choice in this chapter shows up in a timing; a shallow clone into a sandbox (Runtime 13.3 LTS and above for managed tables) costs seconds and almost no storage. And use the view to make the pre-18.1 conversion above painless: once every reader goes through it, the clustered copy goes live with one CREATE OR REPLACE VIEW, and only readers that bypass the view need a rename or a restart. Lineage lists them:
-- who reads the physical table directly, rather than through the view
SELECT DISTINCT entity_type, entity_id, created_by
FROM system.access.table_lineage
WHERE source_table_full_name = 'sales_prd.silver.events'
AND event_time >= current_date() - INTERVAL 30 DAYS;The defaults we'd set, and when we'd break them #
These are the decisions we'd make on day one for a new Databricks estate, written down so that a deviation is a conscious choice with a reason attached.
| Decision | Our default | When we'd deviate |
|---|---|---|
| Managed or external | Managed | Another system owns the files, or a legal location requirement |
| Format | Delta | Managed Iceberg when outside engines write; Iceberg reads on gold tables outside engines only read |
| Partitioning | None under about a terabyte | Well over a terabyte, with nearly every query filtering on one low-cardinality column |
| Layout | Liquid clustering, CLUSTER BY AUTO |
Known, stable filter columns that automatic selection keeps missing |
| Maintenance | Predictive optimization at the catalog level | A table rewritten wholesale nightly, where we'd run OPTIMIZE after the rewrite |
| Deletion vectors | On for update-heavy silver tables | Off where Iceberg v2 reads are enabled; with Iceberg v3 reads (Runtime 18 LTS and above) they can stay on |
| Schema evolution | On in bronze, off in silver and gold | Never in gold; a gold change is a pull request |
| Retention | Set per table from the oldest version anyone replays, never under 7 days | Lowered only through a change review, never during an incident |
| Change data feed | On for silver tables with incremental downstream consumers | Off for append-only bronze, where a stream read is enough |
Beyond the basics #
The features below are standard parts of the table format, and each one replaces something teams otherwise build by hand.
Deletion vectors. A delete, update or merge marks rows in a compact vector beside the file instead of rewriting it, and the rows are purged later by OPTIMIZE or REORG TABLE ... APPLY (PURGE). Writing with them needs Runtime 14.3 LTS and above for every operation (reads, 12.2 LTS). They aren't on for every new Delta table: a workspace setting turns them on for new tables, and defaults vary by region, so check with SHOW TBLPROPERTIES and set delta.enableDeletionVectors explicitly. Enabling them upgrades the table protocol, so older external readers can't read the table any more. For a right-to-erasure process the purge matters as much as the delete: the row is gone from query results at once and from storage only after the purge and a VACUUM.
Change data feed. Set delta.enableChangeDataFeed and the table publishes its own row-level changes, marked as insert, update or delete, readable as a stream or a batch. Downstream consumers stop reimplementing change detection with watermark columns and full-table comparisons, which is homegrown logic that is usually subtly wrong.
Shallow clones. A shallow clone is a new table pointing at the existing files, costing almost nothing and taking seconds. On Unity Catalog managed tables (Runtime 13.3 LTS and above), Unity Catalog tracks which source files its clones need, so a VACUUM on the source doesn't break the clone. Clones are Delta only, can't be nested, and can't be shared through OpenSharing, and dropping the base table eventually breaks them once its files are deleted. Deep clones exist for when you want an independent copy.
Constraints and informational keys. NOT NULL and CHECK constraints are enforced on write, so a bad row fails the pipeline rather than reaching a dashboard. Primary and foreign keys are informational, but they document the model, feed the optimizer, and let BI tools generate correct joins.
Column mapping, type widening and generated columns. With column mapping on, renaming or dropping a column is a metadata operation rather than a rewrite, and type widening lets a column grow from INT to BIGINT without rewriting history. Generated columns derive a value the optimizer can use to skip files, and identity columns give surrogate keys without a sequence table.
Row-level concurrency. On tables with deletion vectors (Runtime 14.2 and above), concurrent writers touching different rows no longer conflict and retry, which matters as soon as more than one stream or job writes to a table.
Multi-statement transactions. With catalog commits on, several SQL statements across managed Delta or Iceberg tables commit as one unit, GA since 14 October 2026. A gold publish that updates a fact table and its summary together no longer needs a staging-and-swap convention to stay consistent.
Where the table layer sits on each platform
| Capability | Databricks | AWS | Azure | GCP |
|---|---|---|---|---|
| Storage you own, open format | Delta and Iceberg in your cloud storage | Parquet or Iceberg in S3 with Glue, or proprietary in Redshift | Parquet or Delta in ADLS, or proprietary in Synapse | Native BigQuery storage, or Iceberg via BigLake |
| ACID transactions on lake files | Yes, native to the format | Iceberg on Athena and Glue, coverage varies by engine | Delta on Fabric and Synapse Spark, varies by engine | BigLake Iceberg tables, or native tables |
| Automatic layout maintenance | Predictive optimization, driven by observed queries | Glue and Athena optimization you schedule and pay for per run | Manual or scheduled maintenance | Automatic inside native BigQuery storage |
| Change a table's layout keys later | Liquid clustering keys change without a rewrite | Iceberg partition evolution, engine support varies | Repartition and rewrite | Clustering is changeable, partitioning is not |
| Row-level change feed | Change data feed built in | Build it with Glue or DMS | Build it with Data Factory | Change history within a limited window |
| Instant zero-copy test copy | Shallow clone | No direct equivalent for lake tables | No direct equivalent | Table clones inside BigQuery |
Credit where it's due. BigQuery's native storage is excellent and needs almost no tuning, and the Glue and Iceberg combination on AWS is a legitimately open architecture. BigQuery's excellence applies inside BigQuery's own storage, though, and the AWS route asks you to assemble and operate the maintenance yourself.
The practical checklist #
Taking over an existing estate, these are the checks we'd run first, and they fit in an afternoon. Count files per table and look for anything averaging under a few tens of megabytes. Check whether a partition column matches what queries actually filter on. Compare retention properties against the history anybody relies on. And confirm predictive optimization is on at the catalog level, because the nightly maintenance jobs it replaces tend to keep running, keep costing money, and compete with the morning refresh for the same tables. The first three are one statement each:
DESCRIBE DETAIL sales_prd.silver.events;
-- numFiles and sizeInBytes: average file size = sizeInBytes / numFiles
-- partitionColumns, clusteringColumns, tableFeatures: layout, and whether deletion vectors or catalogManaged are on
SHOW TBLPROPERTIES sales_prd.silver.events;
-- delta.logRetentionDuration and delta.deletedFileRetentionDuration: how far back time travel reaches
DESCRIBE HISTORY sales_prd.silver.events LIMIT 20;
-- operation and operationMetrics: how often it is rewritten, and by whatThe output turns into three actions. A table averaging under about 32MB per file gets clustering and predictive optimization, and a look at whichever job writes it in tiny batches. A partitioned table whose queries never filter on the partition column gets REPLACE PARTITIONED BY WITH CLUSTER BY on 18.1, or the copy above on older runtimes. And any retention shorter than the oldest version a downstream stream or replay reads gets raised before the next VACUUM runs. The performance side of this continues in Cost and performance.
What's popular