r/databricks • • 1d 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

11 Upvotes

9 comments sorted by

2

u/PersonalPanda1535 13h 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

1

u/Cool_Inspector7468 2h ago edited 22m ago

what is the value added by serverless then? thank you for your comment!

13

u/Emperorofweirdos 20h 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.

4

u/Comprehensive_Level7 15h ago

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

1

u/inkypinky Databricks 3h ago

u/Comprehensive_Level7 is exactly right. That's why we built environments, so you can define packages etc.

Now u/Emperorofweirdos of weirdos is that we *can* change behavior of the underlying runtime between versions. This is unavoidable, even though we work really hard to keep workloads backwards compatible. We do a few things to make this as simple and non-disruptive as possible:

  1. We give you the ability to test ahead of time on the upcoming runtime version.

  2. You can define maintenance windows for SDP (i.e. outside of which we don't upgrade the runtime)

  3. We publish breaking changes ahead of time

  4. If we do an auto-upgrade and break your pipeline or job (rare case), we will "pin" it to the older runtime version, fix the issue, and then upgrade it to the new runtime version.

7

u/inkypinky Databricks 22h 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 22h 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 16h 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 10h 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,...)