The Databricks Data Engineer

The Databricks Data Engineer

What Actually Happens When You Cache a DataFrame

It is lazy, shared, and can be evicted mid-query

Jakub Lasak's avatar
Jakub Lasak
Jul 30, 2026
∙ Paid

Every engineer reaches for cache() when a job runs slow. Most of them make it slower, or change nothing at all, and never find out which.

The problem is that cache() looks like a speed button. You call it, you assume the data is now sitting in memory, and you move on. But nothing about that sentence is guaranteed to be true. cache() is lazy, the storage …

User's avatar

Continue reading this post for free, courtesy of Jakub Lasak.

Or purchase a paid subscription.
© 2026 Jakub Lasak Consulting · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture