r/databricks • • 17h ago

General When does it make sense to use serverless for Jobs and Lakeflow pipelines?

Post image

Hii beautiful people, I am working in a new project situation and we have mainly source systems that do not need Streaming (Full Snapshots) that trigger our Databricks Jobs through Logic Apps.
I got a question from my manager wether to run our Jobs and Lakeflow pipelines on serverless or class job clusters?
What drives the decision? and how do you measure the comparison fairly?
Team of 5. + Frontend(PowerBI) but we are considering testing metric views/AI/BI Dashboards in the near future.
Thanks in advance

10 Upvotes

7 comments sorted by

12

u/Emperorofweirdos 13h ago • Bravo

Gonna add something here since the only other two people who've responded work at Databricks.

They mention versionless serverless, which might be a good thing for most workloads. However, having a few of their versionless products running in prod, I can tell you it's unfortunately not all sunshine and rainbows.

What versionless means in practice is that when the underlying runtime gets upgraded, your job or pipeline can pick up that change on its next scheduled run without you having explicitly opted into the upgrade.

This means things can (and in our experience, have) broken in prod because a previously supported feature is no longer supported, behavior has changed, or new compatibility issues have been introduced that didn't exist in the previous runtime. Not a fun time being woken up at 3am for these changes.

Versionless is great from a maintenance perspective, but it comes at the expense of control over runtime upgrades and the ability to validate those changes before they hit production. It's a trade-off worth considering.

3

u/Comprehensive_Level7 8h ago

cant you set the environment version of a serverless compute in the yaml config? or I'm mixing things up?

7

u/inkypinky Databricks 14h ago

hey u/Cool_Inspector7468 I'm a product manager at Databricks. I recommend starting new workloads on serverless by default. There's no infrastructure to manage, it's super stable, it scales up and down automatically, plus the Databricks Runtime (DBR) gets upgraded automatically.

There are some cases where you should use Classic e.g. Serverless does not support all Spark configs or older Spark APIs like RDDs. But we keep adding new ones - e.g. it now supports df.cache(), whereas previously it would error out. Another reason to use Classic is if Databricks can't reach a resource e.g. database in your private VPC (we are previewing a solution to this, but it's not available everywhere yet).

Actually many people don't know this, there are two "modes" for serverless compute. Performance Optimized starts compute in seconds and scales up fast (more aggressive autoscaler). Standard Mode starts in ~4-6 minutes, and scales up slower. It's cheaper than Performance Optimized.

For Spark Declarative Pipelines, I 100% recommend serverless -- partially because Enzyme (automatic incremental ETL) is only available in serverless SDP.

NOTE: I am not claiming Serverless is ALWAYS cheaper. But we are continuously improving its price-performance. So over time, you are very likely to do well with it, especially if you take into account the cost of maintaining clusters.

4

u/BrickMcBricksterFace 14h ago

I work at Databricks. :)

OP - there is one additional point to consider. You mention you have a small team of 5. Serverless is versionless, so you needn't think about upgrading runtime versions. In other Spark runtimes you have to think about moving code to newer releases at specific periods of time (especially now that AI is finding CVEs in tons of old stuff.)

This means serverless saves your small team from worrying about upgrades.

3

u/zbir84 8h ago

Aren't CVEs fixed via minor version upgrades? Which means they get upgraded as soon as the cluster restarts? For major upgrades, serverless also has environment versions. I wouldn't call it a great feature when the runtime upgrades automatically and breaks your pipeline due to a breaking change.

1

u/Zealousideal_Low6685 2h ago

Like it, we also started with serverless for pipelines.

Probably as an add on:
When developing, serverless is much more comfortable because of faster spin-up times and some features are only availabe with serverless (incremental refresh for materialized views,...)

1

u/PersonalPanda1535 5h ago

On Azure invoice was about double what we expected. A few jobs were still running on two old all-purpose clusters that sat idle between triggers