What you will be able to do
- Explain how the Databricks disk cache speeds up repeated reads of the same Parquet and Delta data
- Tell the disk cache apart from the Apache Spark cache and from the SQL warehouse result cache
- Predict when cached data is invalidated, evicted or lost, and why no manual invalidation is needed after writes
- Choose the recommended way to get disk caching, and spot deprecated or ignored approaches such as CACHE SELECT on newer compute
Key concept
Disk cache (formerly Delta cache) — A proprietary Databricks feature that automatically copies remote Parquet data files, including Delta table files, onto the worker nodes' local SSDs the first time they are read. Later reads of the same data are served locally instead of from cloud object storage.
1.Why repeated reads get faster: copying remote files to local SSD
On Databricks, Delta tables are stored in cloud object storage such as S3 or ABFS. Every scan of a table means fetching Parquet files over the network, and for a dashboard, an interactive analyst session or an iterative job that reads the same table again and again, that remote fetch is paid on every read. The disk cache removes the repeated cost. The first time a worker has to fetch a file from remote storage, Databricks also writes a copy of it to the worker's local disk in a fast intermediate format. The next query that needs the same data reads that local copy instead of going back to object storage.
Three facts in the documentation define the feature. First, it works by creating copies of remote Parquet data files in nodes' local storage using a fast intermediate data format. Second, it is automatic: data is cached whenever a file has to be fetched from a remote location, and you don't call anything to start it. Third, it covers all Parquet data files, including Delta Lake tables. The exam guide still says "Delta cache", but current documentation calls it the disk cache. Databricks says the feature was formerly referred to as the Delta cache and the DBIO cache, and that the disk cache is a proprietary Databricks feature, not part of the Delta Lake protocol. If an exam question asks about the "Delta cache", read it as the disk cache.
Checkpoint 1 of 7· Check yourself
A team queries the same Delta table on a classic cluster many times an hour. What does the disk cache do on the first query that touches a given data file?
Caching happens automatically whenever a file has to be fetched from remote storage, and what gets cached is the file data, not the query result. Rewriting files is compaction (OPTIMIZE), which is a separate feature.
“The data is cached automatically whenever a file has to be fetched from a remote location.”Source: docs.databricks.com
Sources1
2.Disk cache vs Apache Spark cache
Exam questions often mix the disk cache up with Spark's own caching (.cache(), .persist(), CACHE TABLE). They solve different problems. The disk cache works on Parquet files and needs no code. The Spark cache holds a DataFrame or RDD that you choose to persist, usually in memory, and you have to request it in code. The documentation compares them directly:
| Feature | disk cache | Apache Spark cache |
|---|---|---|
| Stored as | Local files on a worker node. | In-memory blocks, but it depends on storage level. |
| Applied to | Any Parquet table stored on S3, ABFS, and other file systems. | Any DataFrame or RDD. |
| Triggered | Automatically, on the first read (if cache is enabled). | Manually, requires code changes. |
| Evaluated | Lazily. | Lazily. |
| Availability | Can be enabled or disabled with configuration flags, enabled by default on certain node types. | Always available. |
| Evicted | Automatically in LRU fashion or on any file change, manually when restarting a cluster. | Automatically in LRU fashion, manually with unpersist. |
The trade-off is coverage against control. The Spark cache can hold things the disk cache cannot, such as the result of an arbitrary subquery or data in CSV, JSON or ORC. The disk cache stores raw file data, so it can't store the results of arbitrary subqueries. Databricks' performance guidance still favours the disk cache: it recommends automatic disk caching and, as a rule of thumb, avoiding Spark caching, because badly placed persists can use up memory and slow queries down. CACHE TABLE is not compatible with serverless compute. If you need to keep an intermediate result, the guidance is to write it to a Delta table instead.
Checkpoint 2 of 7· Match them up
Match each cache to the description that fits it
Tap a term, then the definition that fits it.
The disk cache is automatic and file-based, with data kept as local files on the worker. The Spark cache is manual, applies to any DataFrame or RDD, and is managed with persist and unpersist. The result cache and the SQL UI cache store query results rather than data files.
“The Databricks disk cache differs from Apache Spark caching. Databricks recommends using automatic disk caching.”Source: docs.databricks.com
3.Staying correct: invalidation, eviction and restarts
A cache only helps if it never returns wrong data. The disk cache handles correctness for you: it automatically detects when data files are created, deleted, modified or overwritten, and updates its contents to match. This fits naturally with Delta Lake, because Delta writes new files rather than editing files in place, so a changed table shows up as changed files. That is why the comparison table lists "on any file change" as an eviction trigger. Space is managed the same way: when the cache fills, older entries are evicted in least-recently-used (LRU) order.
The cache lives on the cluster's local disks, so it lasts only as long as the cluster. The SQL caching documentation says the disk cache shares the lifecycle of the local result cache: when the cluster is stopped or restarted, the cache is cleaned and has to be filled again. So the first queries after a restart are "cold" and read from remote storage, and later repeated reads get fast again as the cache refills. Turning the cache off with the configuration flag behaves differently. It doesn't delete data already on local storage; it stops queries from adding to the cache or reading from it.
The disk cache is cleaned when the cluster stops or restarts. The first morning queries have to fetch Parquet files from cloud storage again, which repopulates the cache, and later queries run fast because they read the local copies.
Checkpoint 3 of 7· Check yourself
Which event clears the disk cache so it has to be repopulated?
The cache is on the cluster's local disks, so stopping or restarting the cluster cleans it. Disabling the flag stops cache use but does not drop data already stored.
“This means that when the cluster is stopped or restarted, the cache is cleaned and needs to be repopulated.”Source: docs.databricks.com
Checkpoint 4 of 7· Exam question
A data engineer notices that several notebooks call `df.cache()` (or `df.persist(StorageLevel.MEMORY_AND_DISK)`) on a DataFrame built from a Delta table, expecting this to behave the same way as the cluster's disk cache. During code review, which statement correctly distinguishes the two mechanisms?
Correct answer: A — `df.cache()` is a manual Spark API that materializes one DataFrame's computed result in memory or on local disk for that session, while the disk cache automatically stores raw Parquet file bytes on worker local storage.
- A. Spark's `cache()`/`persist()` is an explicit, DataFrame-scoped operation the developer must trigger and manage, storing a materialized query result. The disk cache instead runs automatically at the file-read layer, caching the raw Parquet bytes for any query that touches those files, regardless of which DataFrame issued the read.
- B. The two mechanisms do not store the same thing: Spark's cache holds a materialized, possibly transformed DataFrame result, while the disk cache holds unmodified copies of source Parquet files, so calling `df.cache()` is not simply a redundant duplicate of the disk cache.
- C. Spark's `cache()`/`persist()` API can spill to local disk depending on the storage level chosen, but it does not write into Unity Catalog managed storage, and it is tied to the active Spark session rather than surviving independently of it.
- D. The disk cache activates automatically the first time a supported cluster reads a Parquet or Delta file; it needs no explicit caching call, and the legacy `CACHE SELECT` style commands are unnecessary on clusters where automatic disk caching is enabled.
4.Getting the disk cache: worker types, flags and CACHE SELECT
Because the cache writes to local SSDs, the hardware you choose matters most. Databricks recommends choosing a worker type with SSD volumes, ideally a cache-accelerated instance type. These workers come already enabled and configured for disk caching, so you don't need to set anything. By default the cache uses at most half of the space on the workers' local SSDs. If you need to change that, you set Spark configuration options when you create the cluster:
spark.databricks.io.cache.maxDiskUsage 50g
spark.databricks.io.cache.maxMetaDataCache 1g
spark.databricks.io.cache.compression.enabled falseCheckpoint 5 of 7· Fill the gap
Which configuration key completes this command, which turns the disk cache on or off for the session?
spark.conf.set("spark.databricks.io.cache. ? ", "[true | false]")spark.databricks.io.cache.enabled is the on/off switch. maxDiskUsage and maxMetaDataCache set how much space is reserved, and compression.enabled controls whether cached data is compressed.
Source: docs.databricks.comOlder material teaches you to warm the cache ahead of time with CACHE SELECT, which copies a chosen set of columns and rows of a Delta or Parquet table into the disk cache. Don't rely on it on current compute. On SQL warehouses and on Databricks Runtime 14.2 and above, CACHE SELECT is ignored and an improved automatic caching algorithm is used instead. On serverless compute, caching is tuned automatically. The current answer to "how do I make repeated reads fast?" is to use SSD-backed or serverless compute and let the automatic cache work.
5.Where the disk cache sits among Databricks SQL caches
SQL warehouses have several cache layers, and exam questions often test whether you can tell which one is meant. The disk cache is the data-level layer: local SSD caching for data read from storage. It speeds up any query that reads the same files, even when the SQL text is different. The result cache works one level up. It stores the result of a whole query, per cluster and optionally in a remote cache on serverless, and returns it when the same query runs again on unchanged data. Both caches are invalidated when the underlying data changes. The difference is scope: a new aggregation over yesterday's files can't use the result cache, but it can still read those files from the disk cache.
Checkpoint 6 of 7· Check yourself
An analyst runs ten different aggregate queries against the same Delta table on a SQL warehouse. No two queries have the same SQL text. Which cache is most likely to speed up queries two to ten?
The result cache only helps when the same query is repeated. The disk cache stores the data files themselves, so any later query that reads the same data benefits.
“Disk cache: Local SSD caching for data read from data storage for queries through SQL warehouses.”Source: docs.databricks.com
Checkpoint 7 of 7· Exam question
Which statement most accurately describes the disk cache feature on Databricks, formerly branded as the Delta cache?
Correct answer: A — It transparently copies remote data files, including Parquet files backing Delta tables, onto the local SSD of the worker node that reads them, so later queries can read from local disk instead of cloud storage.
- A. The disk cache is a Databricks Runtime compute-layer optimization, not part of the Delta transaction log, that copies remote Parquet data files onto local worker SSD storage on first read so subsequent reads of the same files avoid a round trip to cloud storage.
- B. The caching behavior lives in the Databricks Runtime's file-reading layer on the compute cluster, not in the Delta Lake open protocol or transaction log, so other engines reading the same Delta table do not automatically inherit this cache.
- C. There is no separate managed cache table created in Unity Catalog for this feature, and nothing requires an administrator to manually refresh it; the disk cache operates transparently on worker local storage and updates itself when source files change.
- D. The disk cache stores raw source file bytes rather than precomputed query results, and it is unrelated to materialized views, which are a separate feature that stores the output of a defined query rather than cached input files.
Sources4
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.The Delta cache is part of the open-source Delta Lake protocol, so any Delta reader gets it.Why is that wrong?
The disk cache (formerly Delta cache or DBIO cache) is a proprietary Databricks feature. It works on any Parquet files, including Delta tables, and was renamed to clear up this exact confusion.
Covered in Why repeated reads get faster: copying remote files to local SSD
2.After an UPDATE, DELETE or MERGE you have to refresh or clear the disk cache, or queries will return stale data.Why is that wrong?
The disk cache detects created, deleted, modified or overwritten files and evicts stale entries automatically. Writers don't need to invalidate anything.
Covered in Staying correct: invalidation, eviction and restarts
3.To get fast repeated reads on a SQL warehouse, you should pre-warm the cache with CACHE SELECT.Why is that wrong?
On SQL warehouses and Databricks Runtime 14.2 and above, CACHE SELECT is ignored and an improved automatic caching algorithm is used instead.
Covered in Getting the disk cache: worker types, flags and CACHE SELECT
4.Calling .cache() or CACHE TABLE is the recommended way to speed up repeated reads of a Delta table.Why is that wrong?
That is the Spark cache, which is manual, uses memory and isn't compatible with serverless. Databricks recommends the automatic disk cache and, as a rule of thumb, avoiding Spark caching.
Covered in Disk cache vs Apache Spark cache
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“creating copies of remote Parquet data files in nodes' local storage using a fast intermediate data format”
↩︎ Why repeated reads get faster: copying remote files to local SSD“The cache works for all Parquet data files (including Delta Lake tables).”
↩︎ Why repeated reads get faster: copying remote files to local SSD“Disabling the cache does not result in dropping the data that is already in the local storage.”
↩︎ Staying correct: invalidation, eviction and restarts“The recommended (and easiest) way to use disk caching is to choose a worker type with SSD volumes when you configure your cluster.”
↩︎ Getting the disk cache: worker types, flags and CACHE SELECT“The disk cache is configured to use at most half of the space available on the local SSDs provided with the worker nodes.”
↩︎ Getting the disk cache: worker types, flags and CACHE SELECT“Successive reads of the same data are then performed locally, which results in significantly improved reading speed.”
↩︎ Key concept“Disk caching on Databricks was formerly referred to as the Delta cache and the DBIO cache.”
↩︎ Exam trap 1“The disk cache automatically detects when data files are created, deleted, modified, or overwritten and updates its content accordingly.”
↩︎ Exam trap 2“In SQL warehouses and Databricks Runtime 14.2 and above, the CACHE SELECT command is ignored.”
↩︎ Exam trap 3“This name change seeks to resolve confusion that it was part of the Delta Lake protocol.”
↩︎ Prediction“The data is cached automatically whenever a file has to be fetched from a remote location.”
↩︎ Checkpoint“The Databricks disk cache differs from Apache Spark caching. Databricks recommends using automatic disk caching.”
↩︎ Checkpoint“You can write, modify, and delete table data with no need to explicitly invalidate cached data.”
↩︎ Prediction - 2.https://docs.databricks.com/aws/en/lakehouse-architecture/performance-efficiency/best-practicesOfficial docs
“It can improve the performance for a wide range of queries but cannot be used to store the results of arbitrary subqueries.”
↩︎ Disk cache vs Apache Spark cache“As a rule of thumb, avoid Spark caching.”
↩︎ Exam trap 4 - 3.https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-cache-cache-tableOfficial docs
“Databricks recommends against using CACHE TABLE as it is not compatible with Databricks serverless compute architecture.”
↩︎ Disk cache vs Apache Spark cache - 4.
“Databricks SQL UI cache: Per-user caching of query results and SQL editor visualizations in the Databricks SQL UI.”
↩︎ Disk cache vs Apache Spark cache“This means that when the cluster is stopped or restarted, the cache is cleaned and needs to be repopulated.”
↩︎ Staying correct: invalidation, eviction and restarts“Result cache: Per cluster caching of query results for all queries through SQL warehouses.”
↩︎ Where the disk cache sits among Databricks SQL caches“Both caches are invalidated when the underlying tables are updated.”
↩︎ Where the disk cache sits among Databricks SQL caches“Disk cache: Local SSD caching for data read from data storage for queries through SQL warehouses.”
↩︎ Checkpoint - 5.
“On SQL warehouses or in Databricks Runtime 14.2 and above, the function CACHE SELECT is ignored.”
↩︎ Getting the disk cache: worker types, flags and CACHE SELECT